BlankSourceCode / obs-zoom-to-mouse

An OBS lua script to zoom a display-capture source to focus on the mouse
339 stars 29 forks source link

Issue macOS 14.6 for M1 Pro - Not tracking properly #48

Open benjaminfiliatrault opened 2 weeks ago

benjaminfiliatrault commented 2 weeks ago

Description

The tracker works for a little bit and then stop, then work again then stop.

It is not following the mouse on the screen properly

Environment

Notes

I'm using the "macOS Screen capture" since the deprecated Display Capture do not show in Zoom Source

Video of behavior

https://github.com/user-attachments/assets/fcb1de14-b8f2-47d6-bf59-96e9284062fa

Debug logs

Debug logs
[obs-zoom-to-mouse.lua] Zoom crop filter removed
[obs-zoom-to-mouse.lua] Transform info reset back to original
[obs-zoom-to-mouse.lua] Transform crop reset back to original
[obs-zoom-to-mouse.lua] OBS Version: 30.2.3
[obs-zoom-to-mouse.lua] Platform: OSX
[obs-zoom-to-mouse.lua] Current settings:
[obs-zoom-to-mouse.lua] {
[obs-zoom-to-mouse.lua]   use_socket = false,
[obs-zoom-to-mouse.lua]   socket_port = 12345,
[obs-zoom-to-mouse.lua]   socket_poll = 10,
[obs-zoom-to-mouse.lua]   debug_logs = true,
[obs-zoom-to-mouse.lua]   use_auto_follow_mouse = true,
[obs-zoom-to-mouse.lua]   use_follow_outside_bounds = true,
[obs-zoom-to-mouse.lua]   follow_speed = 0.25,
[obs-zoom-to-mouse.lua]   follow_border = 8,
[obs-zoom-to-mouse.lua]   follow_safezone_sensitivity = 4,
[obs-zoom-to-mouse.lua]   use_follow_auto_lock = false,
[obs-zoom-to-mouse.lua]   zoom_value = 2,
[obs-zoom-to-mouse.lua]   zoom_speed = 0.06,
[obs-zoom-to-mouse.lua]   version = 1.0.2,
[obs-zoom-to-mouse.lua]   use_monitor_override = false,
[obs-zoom-to-mouse.lua]   monitor_override_x = 0,
[obs-zoom-to-mouse.lua]   monitor_override_y = 0,
[obs-zoom-to-mouse.lua]   monitor_override_w = 1920,
[obs-zoom-to-mouse.lua]   monitor_override_h = 1080,
[obs-zoom-to-mouse.lua]   monitor_override_sx = 1,
[obs-zoom-to-mouse.lua]   monitor_override_sy = 1,
[obs-zoom-to-mouse.lua]   monitor_override_dw = 1920,
[obs-zoom-to-mouse.lua]   monitor_override_dh = 1080,
[obs-zoom-to-mouse.lua] }
[obs-zoom-to-mouse.lua] Adding transition_start listener to Cut
[obs-zoom-to-mouse.lua] Adding transition_start listener to Fade
[obs-zoom-to-mouse.lua] Finding sceneitem for Zoom Source 'macOS Screen Capture'
[obs-zoom-to-mouse.lua] Looking in scene 'Vertical'
[obs-zoom-to-mouse.lua] Found sceneitem 'macOS Screen Capture'
[obs-zoom-to-mouse.lua] Parsing display name: Built-in Retina Display: 1728x1117 @ 0,0
[obs-zoom-to-mouse.lua] Parsed the following display information
[obs-zoom-to-mouse.lua] {
[obs-zoom-to-mouse.lua]   display_width = 1728,
[obs-zoom-to-mouse.lua]   height = 1117,
[obs-zoom-to-mouse.lua]   x = 0,
[obs-zoom-to-mouse.lua]   y = 0,
[obs-zoom-to-mouse.lua]   display_height = 1117,
[obs-zoom-to-mouse.lua]   scale_y = 1,
[obs-zoom-to-mouse.lua]   scale_x = 1,
[obs-zoom-to-mouse.lua]   width = 1728,
[obs-zoom-to-mouse.lua] }
[obs-zoom-to-mouse.lua] Using source size: 3456, 2234
[obs-zoom-to-mouse.lua] Parsing display name: Built-in Retina Display: 1728x1117 @ 0,0
[obs-zoom-to-mouse.lua] Parsed the following display information
[obs-zoom-to-mouse.lua] {
[obs-zoom-to-mouse.lua]   display_width = 1728,
[obs-zoom-to-mouse.lua]   height = 1117,
[obs-zoom-to-mouse.lua]   x = 0,
[obs-zoom-to-mouse.lua]   y = 0,
[obs-zoom-to-mouse.lua]   display_height = 1117,
[obs-zoom-to-mouse.lua]   scale_y = 1,
[obs-zoom-to-mouse.lua]   scale_x = 1,
[obs-zoom-to-mouse.lua]   width = 1728,
[obs-zoom-to-mouse.lua] }
[obs-zoom-to-mouse.lua] Zooming in
[obs-zoom-to-mouse.lua] Zoomed in
[obs-zoom-to-mouse.lua] Tracking mouse is on (due to auto follow)
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 864, 640
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 864, 598
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 864, 1070
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1373, 562
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1255, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1255, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1255, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1256, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1537, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1538, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1538, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1539, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1539, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1540, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1540, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1540, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1541, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1693, 558
[obs-zoom-to-mouse.lua] Locked area exited - resume tracking
[obs-zoom-to-mouse.lua] Cursor stopped. Tracking locked to 1578, 1113
[obs-zoom-to-mouse.lua] Zooming out
[obs-zoom-to-mouse.lua] Tracking mouse is off (due to zoom out)
[obs-zoom-to-mouse.lua] Zoomed out
aaronfay commented 10 hours ago

Same here. Seems like the dimensions are off, the script will follow the mouse to the upper left, but only about 75% to the right and down 🤔

aaronfay commented 7 hours ago

@benjaminfiliatrault me and Cursor sat down for an hour and played "random Lua generator" until we came up with something that worked for me. No warranty implied: https://gist.github.com/aaronfay/a1b4272b43d83a8088969800e952d9e0

In my instance, whenever the mouse was on the right side of the display, the script would zoom perfectly into the middle, hinting that the retina display values weren't being calculated correctly.