Allow setting custom screen dimensions
Thank you for this script - it works flawlessly for most use cases. However, I have an edge case where I'm using a 5120x1440p monitor and I only want to share the first half of its screen i.e. 2560x1440p. After adding the source, I have cropped 2560p from its right side, and then resized it to 1920x1080p, which is my canvas size. However, upon using your script, each time it zooms out, it resets the crop to 5120x1440p using a filter, and I don't see an option in the script's settings to specify a custom value for those dimensions (which in my case would be 2560x1440).
Can you please add the option to use custom values for these in the script's settings? (You could still default to getting these values from the monitor's default resolution, but provide a check box for those with a use case like me to override those default values.)
^ I'm here for the same.
I've recently upgraded to a ultrawide monitor (3440x1440) however attempting to use the script will not work as expected, and even toggling off it just keeps my source stuck in what I believe is a 16:9 ratio and I have to literally delete the source and re ad it to get my correct aspect ratio and see everything on the screen.
Having the option to choose the base res + 'zoomed' res would be an awesome fix
@HQRaja A base res override sounds like something I can add in.
@TommoFromGezel I also use an ultrawide monitor (3840x1600). When zooming it goes to whatever the zoom window is set to; mine is usually set to 1600x900. When zooming back out, it restores back to the native res of the monitor. It can get cut off the canvas, but that's not an issue with the source. I would change the transform settings to enable a bounding box set to "Scale to Inner Bounds" and the bounding box size to the canvas resolution, or whatever resolution you want.
@tryptech That would be awesome, thank you.
@tryptech Just tested it...works like a charm! Thank you for sorting it out this quickly.
Hey @tryptech sorry I'm only getting back to you, I guess GH didn't want to give me notifications.
So I've just tried your suggestion and the same odd things occur. This time I've attached a video for you to see what is occurring on my end which should hopefully help understand the issue I'm facing.
edit: sorry for the terrible resolution, if you need a clearer one lmk!
Also noticed you released a new version 7 days ago, just wanted to let you know the issue persists with that also sadly
If i look at the video you sent, you aren't even getting the option to enable the monitor override in the script settings. Can you switch between a few sources to see if that option shows up?
Sure, I'll have more testing done for you tomorrow with a new vid in better resolution!
Where exactly should I see thatt option? In the script settings itself I presume?
@tryptech I got some new tests done, and I also opened up the script logs to show you also, potentially a problem with my python? Here's the script output:
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 371, in toggle_zoom
[zoom_and_follow_mouse.py] zoom.update_source_size()
[zoom_and_follow_mouse.py] File "C:\Users\thoma\Documents\MEGA\Personal\OBS and Tools\OBS PYTHON\zoom_and_follow_mouse.py", line 66, in update_source_size
[zoom_and_follow_mouse.py] data = loads(data)['monitor']
[zoom_and_follow_mouse.py] KeyError: 'monitor'
I threw this all together in Clipchamp to ensure having two OBS's wasn't causing a conflict either, hopefully the resolution is clearer this time: https://clipchamp.com/watch/kCUmEVYmltF
I'm not sure what version of the script you're using but in trying to follow the traceback, which seems to be the same error, I don't even see that code there. I don't even have the line "data = loads(data)['monitor']" in the code anymore. I need you to make sure that the .py file you're loading up is the same as the one in the most recent commit. Meaning you should see a version number in the script description when it is loaded into OBS.
I plan on doing a complete fresh Windows install in the coming days, so will do fresh installs of all of this and update you. Consider this thread paused for a few days :)
@tryptech I'm happy to report after a LOT of trial and error and fighting with Python, I finally have this working. Thank you so much for all your patience! win32api seems to have been the main problem, but a cheeky reboot and reinstalling some pypiwin32/pywin32 combos got me here.
Thanks for all your help!
A lot of instances of problems tend to be with python or win32api so it might be worth me making install script. Regardless, glad you got it working!