Resource icon

Zoom to Mouse 1.0.1

ov10fac

Member
I downloaded the script, built out a scene, and tried both a window and display capture, but the zoom source always has <none> in it. I restated OBS, deleted the script file, and uploaded it again with no luck. I am running it on a Mac Book Pro with an M4 chip, unsure if this is the issue. Any support would be great! Thank you.
Same problem on Ubuntu 24 and OBS 30. Any suggestions?
 

marina_a_sh

New Member
I had the same problem on Ubuntu 24.04 and OBS 31.0.1.
To fix it for Linux you need to change a line in the get_dc_info function
(line 209 in the latest [Feb 7, 2024] obs-zoom-to-mouse.lua on the github:
https://github.com/BlankSourceCode/obs-zoom-to-mouse/blob/main/obs-zoom-to-mouse.lua)
source_id = "xshm_input"
should be
source_id = "xshm_input_v2"
Only sources with this id are added to the 'Zoom Source' list.
The display name for this id in the selection list of Sources dock is "Display Capture (XSHM)".
It seems that at some point id was changed to version 2.

For macOS source_id is chosen based on the OBS version (see get_dc_info function).
If OBS version > 29.0, then source_id = "screen_capture",
if OBS version <= 29.0, then source_id = "display_capture".
There is some indication (https://github.com/obsproject/obs-s...0/plugins/mac-capture/mac-sck-video-capture.m)
that starting OBS 30.0 "screen_capture" is an id for some video capture source.
It might be that wrong lookup source_id is chosen for your macOS + OBS version combination.

To debug the issue:
1. in OBS select menu item Tools > Scripts
2. click [+] button and add the latest obs-zoom-to-mouse.lua script
3. click 'Edit script' button
4. scroll to the last function in the script: function populate_zoom_sources(list)
5. add one extra line to the populate_zoom_sources function to log debugging info
...
for _, source in ipairs(sources) do
local source_type = obs.obs_source_get_id(source)
log(source_type .. " is compared to " .. dc_info.source_id)
...
6. Save
7. click [⟳] button to reload the script
8. check 'Enable debug logging' checkbox (scroll down or make Scripts window bigger to see this option)
Script Log window opens up (it can also be opened manually by clicking 'Script Log' button)
10. click 'Refresh zoom sources' in the Scripts window
11. example debug output on Linux:
[obs-zoom-to-mouse.lua] image_source is compared to xshm_input_v2
[obs-zoom-to-mouse.lua] xshm_input_v2 is compared to xshm_input_v2
12. See if there is a match that should become a choice for the 'Zoom Source' dropdown list.

My guess for macOS with the issue of no valid entries in the 'Zoom Source' list is that you will see a mismatch in the log like this:
[obs-zoom-to-mouse.lua] display_capture is compared to screen_capture
In that case make changes in the macOS section [ffi.os == "OSX"] of the get_dc_info function:
change
source_id = "screen_capture"
to
source_id = "display_capture"
Also, try different prop_id and prop_type combinations that are set together with the source_id in the get_dc_info function for macOS.

Note: <None> line is always present in the 'Zoom Source' dropdown list even when there are other choices. Try to open the dropdown to see all the options.
 

marina_a_sh

New Member
Another way to solve the problem of no entries in the 'Zoom source' list is
to check 'Allow any zoom source' checkbox. 'Zoom source' list will be populated with all available sources.
If you can guess correctly what source is a display capture source choose it,
otherwise just follow tooltip's instruction: "You MUST set manual source position for non-display capture sources".
 
Top