Resource icon

Zoom and Follow 0.1.0

tryptech

New Member
tryptech submitted a new resource:

Zoom and Follow - Zoom and follow the mouse on a desktop source

Have you ever needed to zoom in on your screen to show some fine detail work, or to make your large 4k/ultrawide monitor less daunting? Zoom and Follow for OBS Studio does exactly that, zooms in on your mouse and follows it around. Configurable and low-impact, you can now do old school Camtasia zoom ins live

Inspired by caharkness's Magic Window

Read more about this resource...
 
Does it actually work?
  • I have installed Python 3.7.9, and installed the two dependency Python packages as well (Pynput and Screeninfo).
  • I also made sure to point to the Python install folder path.
  • When I add the zoom_and_follow_mouse.py script into the script list in OBS, I get a statement that merely says "No properties available".
  • I can tell by looking at the zoom_and_follow_mouse.py file in a text editor that certainly are supposed to be a slew of properties.
 

upgradeQ

Member
Does it actually work?
  • I have installed Python 3.7.9, and installed the two dependency Python packages as well (Pynput and Screeninfo).
  • I also made sure to point to the Python install folder path.
  • When I add the zoom_and_follow_mouse.py script into the script list in OBS, I get a statement that merely says "No properties available".
  • I can tell by looking at the zoom_and_follow_mouse.py file in a text editor that certainly are supposed to be a slew of properties.
If you are on windows then you must install Python 3.6 , here the link ,select x86-64 if you are using 64 bit OBS, x86 if 32 bit OBS.
 
I got it to work after switching to 3.6. Thx.

It works well! zooming and panning is nice!

It was tricky to get the zooming set up, as when I record a 1920x1080 screen, the "display" of that screen is within a Display Capture that is sized down somewhat, to make room for branding, lower thirds, titling, etc.

Might I suggest that you provide some instruction as to how to set up the zooming?
Thx!!
 
I am trying to set up a scene for each of 3 different zoom levels, along with a 4th at "full" (100%).

Currently, I have 3 versions of the script that have the very last If statement looking like this:

if zoom.source_name != "" and zoom.flag: zoom.update_monitor_size() obs.timer_add(zoom.tick, zoom.refresh_rate) zoom.lock = True zoom.flag = True # elif not zoom.flag: # zoom.flag = True # zoom.lock = False

Notice I have set both the zoom.lock and zoom.flag to True, and commented out the elif statement.

What this gets me is each of the 3 zoom scenes only allow a zoomed view, and cannot be zoomed out.... that is what you get when you select the "100%" scene.

This is working, except for one thing: the first time after starting OBS, and selecting one of the 3 zoom scenes, it does execute an actual zoom effect -- which is not what I want -- I want the scene to be at the desired zoom level to start. (I am wanting the zoom "effect" to be derived from a simple scene fade.)

I also tried setting the Zoom Duration for each version of the script to be "0", but there is still a flash when changing each zoom scene for the first time, as the zoom process seems unavoidable.

Any ideas?
 
Perhaps someone can help me. Running obs 26 on Windows 10 Pro 64, I have Python 3.6, the plugin creates the following error message:

[zoom_and_follow_mouse.py] File "C:/Program Files/obs-studio/data/obs-plugins/frontend-tools/scripts\zoom_and_follow_mouse.py", line 7
[zoom_and_follow_mouse.py] <!DOCTYPE html>
[zoom_and_follow_mouse.py] ^
[zoom_and_follow_mouse.py] SyntaxError: invalid syntax
[zoom_and_follow_mouse.py] File "C:/Program Files/obs-studio/data/obs-plugins/frontend-tools/scripts\zoom_and_follow_mouse.py", line 7
[zoom_and_follow_mouse.py] <!DOCTYPE html>
[zoom_and_follow_mouse.py] ^
[zoom_and_follow_mouse.py] SyntaxError: invalid syntax

Any ideas what's causing this?
 

tryptech

New Member
Perhaps someone can help me. Running obs 26 on Windows 10 Pro 64, I have Python 3.6, the plugin creates the following error message:

[zoom_and_follow_mouse.py] File "C:/Program Files/obs-studio/data/obs-plugins/frontend-tools/scripts\zoom_and_follow_mouse.py", line 7
[zoom_and_follow_mouse.py] <!DOCTYPE html>
[zoom_and_follow_mouse.py] ^
[zoom_and_follow_mouse.py] SyntaxError: invalid syntax
[zoom_and_follow_mouse.py] File "C:/Program Files/obs-studio/data/obs-plugins/frontend-tools/scripts\zoom_and_follow_mouse.py", line 7
[zoom_and_follow_mouse.py] <!DOCTYPE html>
[zoom_and_follow_mouse.py] ^
[zoom_and_follow_mouse.py] SyntaxError: invalid syntax

Any ideas what's causing this?
It's possible you downloaded a webpage and saved it as they python file. None of the python code should start with that line, that's HTML. Try to redownload the python script from this link
 
It's possible you downloaded a webpage and saved it as they python file. None of the python code should start with that line, that's HTML. Try to redownload the python script from this link
Thanks for helping me out. I don't have much experience with Python but expected the link to download a .py file. (as happened with other python scripts I downloaded) However, it showed a page with code. I copy pasted it into a .txt file and changed the extension into .py.
This time, I get another error message:

[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:/Program Files/obs-studio/data/obs-plugins/frontend-tools/scripts\zoom_and_follow_mouse.py", line 2, in <module>
[zoom_and_follow_mouse.py] from pynput.mouse import Controller # python -m pip install pynput
[zoom_and_follow_mouse.py] ModuleNotFoundError: No module named 'pynput'

Not sure what I should do now.
 
Would you want the pan to only move to the mouse on a hotkey press or something along those lines?

My thought was to make it so a
Would you want the pan to only move to the mouse on a hotkey press or something along those lines?

Yeah... basically, when I switch to a scene that has a predefined zoom level, I’d like the option zoom so the mouse is centered, or in the up left corner... maybe allow some options on that.

Then the pan only gets activated when the user decides too.
 

tryptech

New Member
Thanks for helping me out. I don't have much experience with Python but expected the link to download a .py file. (as happened with other python scripts I downloaded) However, it showed a page with code. I copy pasted it into a .txt file and changed the extension into .py.
This time, I get another error message:

[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py] File "C:/Program Files/obs-studio/data/obs-plugins/frontend-tools/scripts\zoom_and_follow_mouse.py", line 2, in <module>
[zoom_and_follow_mouse.py] from pynput.mouse import Controller # python -m pip install pynput
[zoom_and_follow_mouse.py] ModuleNotFoundError: No module named 'pynput'

Not sure what I should do now.

You didn't install the python modules that the script is dependent on. Please check the github page and follow the instructions for all of the dependencies necessary.


My thought was to make it so a


Yeah... basically, when I switch to a scene that has a predefined zoom level, I’d like the option zoom so the mouse is centered, or in the up left corner... maybe allow some options on that.

Then the pan only gets activated when the user decides too.

I'll look into it; no guarantees on when it gets done though.


For future reference everyone, I rarely look at the forums. Please post any issues/feature requests on the github repositorty here
 
You didn't install the python modules that the script is dependent on. Please check the github page and follow the instructions for all of the dependencies necessary.
Thanks for being patient with me but I'm just learning about Python and github. When I go there I see all sorts of files and don't know which one to download, let alone how to install these into Python 3.6. I need some more specific directions for both dependencies. Thanks!
 

Kamelot

New Member
I'm having problem to make it work with my 4k monitor. Did someone else have try it in high resolution? Works, but didn't show my entire monitor and when unzoom, it get back to another monitor resolution (in my case 768x1366)
 

Videobuff

Member
Hi, I love the idea of this and saw it working and it looks great, really useful!!!....I installed the Python version mentioned and then the script no problem, the Zoom works fine in OBS, however the one thing I just can't get to work is the mouse tracking, no matter what settings I adjust in the script. Once the zoom happens, then it just remains static after that until I hotkey and unzoom. I can see the mouse cursor moving about but no tracking. I noticed on the Github that a fix for the zoom_and_follow_mouse.py script was applied since others who have it working installed it, maybe that's my problem?...I don't have a copy of the script before those fixes were implemented so I have no way to test that theory.....any way that version can be made available to try? Or maybe you have any other suggestions that I might try?
 

Videobuff

Member
Hi, I love the idea of this and saw it working and it looks great, really useful!!!....I installed the Python version mentioned and then the script no problem, the Zoom works fine in OBS, however the one thing I just can't get to work is the mouse tracking, no matter what settings I adjust in the script. Once the zoom happens, then it just remains static after that until I hotkey and unzoom. I can see the mouse cursor moving about but no tracking. I noticed on the Github that a fix for the zoom_and_follow_mouse.py script was applied since others who have it working installed it, maybe that's my problem?...I don't have a copy of the script before those fixes were implemented so I have no way to test that theory.....any way that version can be made available to try? Or maybe you have any other suggestions that I might try?
UPDATE: I got it working and I must say it's really useful. The fix was staring me in the face but only triggered for me when I saw another users comment elsewhere about ...put very simply the fix was just NOT use the same Hotkey for both the Zoom and the Follow functions. In fact it works with just a single hotkey for me as well on the Zoom. Hope that helps anyone experiencing a similar issue.
 
Top