Resource icon

OBS Lua Zoom to Mouse 1.0.1

An OBS lua script to zoom a display-capture source to focus on the mouse when you press the assigned hotkey. You can optionally toggle following your cursor so that it is always in view while zoomed in. Cropping and positioning of the source is also supported.

I made this script for my own use when recording videos. I wanted a way to zoom into my IDE when highlighting certain sections of code. I know there are existing solutions for zooming in OBS but I couldn't get them working the way I wanted with my setup, so I made this.

Maybe it will be useful for someone else too.

Now supports Windows/Mac/Linux
Author
BlankSourceCode
Downloads
68,518
Views
137,561
First release
Last update

Ratings

4.17 star(s) 23 ratings

More resources from BlankSourceCode

Latest updates

  1. Added support for Mac and Linux

    If you are using OBS on linux or mac, you should now be able to use this script to zoom to a...

Latest reviews

Works great BUT did stop working after updating to OBS 32 (Windows, 64 Bit). HOWEVER I can confirm that the fix posted by @havesomejoe below does work in OBS 32.0.4!

To reiterate, you need to go into the script and edit the following entries:

"obs_sceneitem_get_info" to "obs_sceneitem_get_info2" (3 instances)
"obs_sceneitem_set_info" to "obs_sceneitem_set_info2" (1 instance)

Doing this didn't work for me at first when I edited the script through OBS > Tools > Edit Script. But it did work when I completely removed the script from OBS and edited the file separately. Just remember to take a screenshot of your original settings before this so you remember what you had.

I also had to rebind my hotkeys but, other than that slight hiccup, everything seems to work as it did prior to updating!
Have been using for a while after seeing Nutty's tutorial. Brilliant plugin! OBS 32 broke it for me but havesomejoe's post in this thread fixed it instantly.
Completely broken on Linux with Wayland, does not show any display sources, and even if you check "allow any zoom source" it won't follow the mouse. nobody seems to care about fixing it either
Works great. FYI to anyone struggling: The script is using two functions that were deprecated.

Edit the script and change:

obs_sceneitem_get_info → obs_sceneitem_get_info2 (3 occurrences)
obs_sceneitem_set_info → obs_sceneitem_set_info2 (1 occurrence)
This script was amazing when it was working. A recent update to OBS has broken the code. I hope whoever made this sees these reviews and can fix it soon.
This is a great plugin making it possible to see text from apps with horrible font size. Not just for the streaming audience, but for myself too by putting up a obs preview on another screen. One problem is that it just seem to work on the main screen.

After updating obs today I get this: "[obs-zoom-to-mouse.lua] Failed to call frontend_event_callback for frontend API: [string "C:/VIDEO/obs-studio/data/obs-plugins/frontend..."]:560: attempt to call field 'obs_sceneitem_get_info' (a nil value)"
The zoom function doesn't work on macOS. Even after selecting MacBook Display and configuring a hotkey, no zoom occurs.
This is a great scripting tool, it would be even better if it could automatically follow the mouse to zoom in and out! Instead of using shortcut keys to trigger now, because using shortcut keys to trigger always feels like the operation is still troublesome! Thank you to the developers for sharing
Doing nothing on hotkey. Settings made according to github recomendations. OBS 30.2.0
This is exactly what I was looking for my next project. Thank you so much.

It works flawlessly.
Back
Top