-
Notifications
You must be signed in to change notification settings - Fork 62
Proper MacOS Support #97
Comments
In doing a deep dive for properly detecting monitor sources, I'm finding that OBS does not properly report the settings for the macOS Screen Capture source. In the case of Windows and Linux, there are separate sources for window capture and monitor capture. This makes it easy for me to determine what a user wants to do given a source selection and lets me branch the code appropriately. MacOS, from 12.5 onwards, uses a single source type for both monitor capture and window capture. I'm going to leave the existing code as is for dealing with older Macs and I'm going to write separate handling methods for Window capture and Display capture for newer Macs to avoid breaking any existing functionality. |
I have preliminary support for macOS screen capture for macOS 12.5+ as of commit 3807d36. I also have tried to offset/avoid delays where I can for now: macOS will primarily only lag now on script initial load, script reload, source change, and source refresh. Changing source settings should no longer cause lag. This should also provide minor improvements to script performance on Windows and Linux. There is still a minor ~1 second lag on macOS when zooming in or out: I will have to revisit that later. |
Current Setup:
I pulled down the mac-rewrite branch and I've been able to successfully select my source and zoom in and out. My only issue now is that the mouse position doesn't seem to be tracked properly. In order to get the zoomed area to move, my mouse has to venture outside of it. This also prevents it from being able to reach the edges of the screen. I can't get the very top or the sides of the screens into the zoomed area. |
Current Setup: To add to @obsidiantech , I'm experiencing something similar, but different... Using Display Capture on my Second Monitor, ✔️ I've also be able to select my source and zoom in and out. ✔️ It follows my mouse vertically from the top edge of my screen all the way to the bottom edge of my screen |
@HeyBradyLang @obsidiantech Could I get an illustration from you both of how your monitors are laid out, with labels of each monitor's physical native resolution, the resolution reported by macOS (if possible similar to how #95 finds that OBS and pywinctl get a reported resolution of 1512*944), and which one is the primary monitor? I can't get to it really until next weekend, but I'd like some data on the issue. |
I pulled the most recent, updated commit of the script (68868e9) and the Zoom and Follow work, except, I'm facing this issues as well:
So, my primary display is my Laptop Screen and Secondary is a LG Widescreen Monitor. It is arranged similarly, where x=0 is the leftmost side of my laptop and x=2658 is the rightmost side of my laptop. Canvas = 3840 x 2160.
Follow Zooming In/Out I have set my manual monitor size (3440x1440) and the transform is set correctly. (Stretch to Outer Bounds, Center, etc.) |
HI @tryptech, I am working on a new version of pywinctl module (v0.1). Amongst other improvements, this new version fixes two issues which may affect your module, and especifically in macOS:
We can work together to check if this new version helps to solve some of your issues, before I upload it to PyPi (I have not uploaded it yet, I mean, and will wait until you have the time to check this new version if you intend to do so). |
Very good, I recently worked on some macOS code so any improvements there are much appreciated. I haven't delved too deeply into the multi monitor issues that have been reported since I don't use multiple monitors now, but I'm willing to test how it affects this modules multiple monitor support on Windows and Mac |
Nice! I have the same problem: I don't own a "real" macOS and the VMs I use to test do not allow multi-monitor. We can perhaps try to find a workaround or any other user with a multi-monitor setup which mercifully wants to help! As a last resort, I think I can borrow "real" macOS for some days if needed. Please, check this for some multi-monitor tips in macOS. Besides, you can download new version wheel from here and perform your own tests to check if some issues are already solved or I have to further work on them! Any help you need, just let me know. |
I have an actual Mac Mini and an iPad, so Sidecar should let me test multi monitor on macOS specifically, I just haven't had a chance to try it out yet. I'll grab the wheel and try to figure out what I can over this weekend. |
good news! Of course, no hurries, don't worry. Don't know if you are struggling with screen coordinates (if so, you have to be prepared to handle negative values in multi-monitor setups), or if you need to check whether a window has changed its position or status or has been moved to another monitor... Check the issue I was linking, as well as pywinctl features just in case it can help with that kind of things. Also, just ask me if you have a doubt (I don't have a clue about OBS, but I do know a few things about windows!). |
Hi again, @tryptech. I've been making some additional tests, but still incomplete since I don't have access to the required full setup. By the moment, I think my assumptions, at least in macOS, were wrong. I will have to get at least 3 monitors and an actual macOS. I will keep you informed on any progress. If, as a result of your own tests, you get any additional info or comment, I would really appreciate if you let me know. |
Hi Guys, I have tried the script on my Mac M1 today, its all working ,but when its zoom it it zoom to 0,0 dimension window, will issues be solved anytime soon ?! |
Multi-monitor test dummy reporting again for duty! Note: I'm currently on Catalina as I use this build primarily for music production and VST plugin support is shaky for older plugins that I would like to keep using. System Info: Here's my log when triggering a hotkey:
|
Hi everyone! I eventually managed to test in an actual macOS with a multi-monitor setup (x2). Everything is working OK (at least in my system) and has been updated in new PyWinCtl v0.1 version (donwloadable directly from PyPi). This update is based in two new custom modules: PyWinBox (useful to define and control any rectangular area, including a window area) and PyMonCtl (aimed to get info on and control monitors, especially in multi-monitor setups, and including a watchdog which will track and notify monitors changes). In case you find any issue, please let me know here |
Wonderful, I just updated last night to improve multimonitor support and HiDPI support, particularly on apple silicon based macs, as well as adding in that dependency on PyMonCtl. I'll have to look into using that watchdog for monitor updates later |
@tryptech, just in case it is helpful in your case. In PyWinCtl you can set a watchdog passing a callback to be invoked when the window changes the monitor is in (as well as when it changes position, size, etc.). The callback will receive the new monitor name (you can also get it using getDisplay() method if you don't want to set a watchdog). This monitor name can be directly used within PyMonCtl, where you can also set a watchdog to track monitor changes. In short, combining both you can track/control every window and the monitor it is in. Just let me know if you need help. |
I'm going to use this as the master issue for triaging all of the Mac related issues as I start to build that functionality out properly. I will be addressing these issues as I go along in the separate branch mac-rewrite. Please note any issues in functionality here as I build out support in that branch if you choose to test it.
I'm basing all of this work around an M2 Mac Mini running macOS Ventura 13.2.1 so I appreciate your understanding if the script does not end up working properly on older versions of macOS or Intel-based Macs. I believe the OBS code itself branches at macOS version 12.5 with the introduction of M1 Macs, so I am looking for maintainers for Intel-based Macs below macOS 12.5.
Current Issues:
Not detecting monitor sources (MacOS - TypeError: tuple indices must be integers or slices, not str #82, Zoom source list empty on MacOS 13.2 (22D49) Chip Apple M1 Pro #95)Slow loading of monitor sources (MacOS - TypeError: tuple indices must be integers or slices, not str #82)Improper mouse tracking at HiDPI (Zoom source list empty on MacOS 13.2 (22D49) Chip Apple M1 Pro #95)Improper mouse tracking across multiple monitorsThe text was updated successfully, but these errors were encountered: