Coder Social home page Coder Social logo

Comments (31)

clarkio avatar clarkio commented on May 30, 2024 2

@IAmTerrific I moved to this previous version of the script and dependencies. This got it working consistently for me. https://github.com/tryptech/obs-zoom-and-follow/tree/68e1aef99cb2d55a60324e1ea9d48f92815f8949

@tryptech having switched to the previous script version with the other dependencies I'm thinking the issue is around the use of PyWinCtl. I'd be happy to try and debug this further but I'm not familiar with how I can do that in an efficient way with the dependency on loading the script into OBS

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024 1

It's been a few months, someone did submit a PR that fixed a bug for single monitor users. I don't think it affects your case in particular, but if you discover anything, let me know and I'll reopen the issue.

from obs-zoom-and-follow.

IAmTerrific avatar IAmTerrific commented on May 30, 2024

Restarting OBS fixes the error for a moment. Plugin is straight up broken, and permanently breaks and Desktop Capture source I use it on by setting it to zoom into the top left pixel whenever leaving zoom mode. Until it eventually starts giving the above error again and breaks entirely.

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

I need more information than that
OS, python version, OBS version, monitor sizes and relative positioning, anything.

I'm running a 3840x1600 and a 2560x1440 monitor right next to each other and I have no issues, so I need something to go off of.

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

I'm experiencing similar results with the script not working. Here is some more information on the context in which the issue shows up:

I'm on Windows 10, OBS 27.2.4 (64 bit), main monitor used for zoom and follow is 2560x1440, monitor capture properties is set to the following:
image

Script settings are set to the following:
image

I'm not sure if that information helps but I hope so. I'm happy to share more that might help as well. Thanks for putting this together and I hope to get it working to use.

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Also here's my Python packages with versions:
image

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

Could you record a short clip of what happens when you zoom in and out from OBS?

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Sure I could try but it doesn't zoom in or out so I wouldn't have much to show in that regard. I press the keyboard shortcut I assigned to it and then the script log pops up with the error message.

Also I modified the script to print out the contents of what loads(data) returns and can see it's missing the key monitor which is causing the error. Here's an example: {'capture_cursor': True, 'method': 1}

from obs-zoom-and-follow.

IAmTerrific avatar IAmTerrific commented on May 30, 2024

2022-04-07 16-03-12.zip
Okay i got the broken zooming to run without producing the error, i just made sure to restart OBS after loading the script and assigning the source, not sure if that is what avoided it though, but I spammed it a whole bunch this time and so far no error message.

The source starts at 1920x1080 (scaled down from 2440x1440), centered, set to scale to bounds, bounds set to 1920x1080.

The first zoom works, but then disabling zoom sets the source transform to .75 x .75 as indicated in the edit transform box.

from obs-zoom-and-follow.

IAmTerrific avatar IAmTerrific commented on May 30, 2024

Additional requested info:
Capture

Windows 10 (64 bit)

OBS version 26.2.4 (64 bit)

Primary Monitor: 2440x1440 @ 0,0
Secondary Monitor: 1920x1080 @ -1920 , 218

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

@IAmTerrific oh I wanna make sure I understand how you resolved it. You loaded the script, set the source up and then restarted OBS?

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

I kinda get it to work with that but it zooms in a huge amount even with Zoom Window Height and Width set to 1280 and 720 respectively.

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

It doesn't seem to pick up the mouse and maybe that's what is causing the issue? I'm at a loss now and have spun on this for quite some time.
https://user-images.githubusercontent.com/6265396/162338991-5124aa88-c40f-49f3-aa5a-91eb0ba0e470.mp4

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

Also I modified the script to print out the contents of what loads(data) returns and can see it's missing the key monitor which is causing the error. Here's an example: {'capture_cursor': True, 'method': 1}

So when you load the script up, do you already have any existing window/desktop sources? If you create them after loading the script I think that it doesn't load up the sources properly so I might have to revisit that for a performant way of updating that list.

from obs-zoom-and-follow.

IAmTerrific avatar IAmTerrific commented on May 30, 2024

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Also I modified the script to print out the contents of what loads(data) returns and can see it's missing the key monitor which is causing the error. Here's an example: {'capture_cursor': True, 'method': 1}

So when you load the script up, do you already have any existing window/desktop sources? If you create them after loading the script I think that it doesn't load up the sources properly so I might have to revisit that for a performant way of updating that list.

I already have an existing window/desktop source

from obs-zoom-and-follow.

IAmTerrific avatar IAmTerrific commented on May 30, 2024

@clarkio thank you that fixed it, working wonderfull! 👍

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

Also I modified the script to print out the contents of what loads(data) returns and can see it's missing the key monitor which is causing the error. Here's an example: {'capture_cursor': True, 'method': 1}

Very odd, I just did a print of loads(data) before doing anything else and I got:
{'capture_cursor': True, 'method': 0, 'monitor': 0, 'monitor_wgc': 0}

It makes sense that the error is happening from a lack of monitor key, but I'm not experiencing the issue myself.
I'm on Windows 11, but it's almost Windows 10 under the hood so I'm not sure what's happening there. I'll try to see if it's getting skipped somehow in PyWinCtl.

EDIT: ignore that last line. It's more likely an OBS issue. I'm pulling JSON data about the source from obs so I expect it to have certain information. Somehow or another your OBS instance is not listing out monitors by ID. Even more odd, I'm on the same version of OBS as you and it reports monitor IDs to me.

from obs-zoom-and-follow.

OmaGamer avatar OmaGamer commented on May 30, 2024

I'm having the same issue where is the loads Json file ?

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

I believe I've corrected the issue as of 65d92ff

Can you test and see if the issue persists?

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Hmm updated my local script with your latest changes and I'm still getting an issue when activating it

sample-issue-recording.mp4

Here are my script settings too:
image

The script logs show the following details:

[zoom_and_follow_mouse.py] Key 'monitor' does not exist in data
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Key 'monitor' does not exist in data
[zoom_and_follow_mouse.py] {}
[zoom_and_follow_mouse.py] Key 'monitor' does not exist in data
[zoom_and_follow_mouse.py] {}

Does my version of Windows matter? I'm on Windows 10 Version 21H2 for x64 using OBS 27.2.4 (64 bit). Python is version 3.6.8 and pywinctl is 0.0.32.

I made sure to adjust the transform on my desktop capture source to be center and stretch to inner bounds. Here are the settings for that:
image

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

Hm, I wonder if there's a difference in the data structure for windows 11. Seems like an unreasonable assumption, but I might have to look into that

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

@clarkio Here's a version of the plugin that should output all of the display source monitor data in the script log.
Would you mind running it and giving me the full output?

debug_output.zip

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Tried and here are the results:

[zoom_and_follow_mouse_debug.py] Key 'monitor' does not exist in data
[zoom_and_follow_mouse_debug.py] Source name: Display Capture
[zoom_and_follow_mouse_debug.py] Source: 
[zoom_and_follow_mouse_debug.py] <Swig Object of type 'obs_source_t *' at 0x...>
[zoom_and_follow_mouse_debug.py] Source Settings: 
[zoom_and_follow_mouse_debug.py] <Swig Object of type 'obs_data_t *' at 0x...>
[zoom_and_follow_mouse_debug.py] OBS Data: 
[zoom_and_follow_mouse_debug.py] {}
[zoom_and_follow_mouse_debug.py] {}

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

Oddly enough, the data from the OBS source is completely blank.

I'm normally expecting an output like this:

[zoom_and_follow_mouse.py] Source name: Display Capture
[zoom_and_follow_mouse.py] Source: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_source_t *' at 0x000001F83679AFC0>
[zoom_and_follow_mouse.py] Source Settings: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_data_t *' at 0x000001F8558F3210>
[zoom_and_follow_mouse.py] OBS Data: 
[zoom_and_follow_mouse.py] {"capture_cursor":true,"method":2,"monitor":0,"monitor_wgc":0}

Your display capture source properties look like this?
image

EDIT: It also seems to be the case that your script log isn't outputting any hex address at all. There may be something different between our setups that's causing this, maybe python, maybe obs. I'm not 100% sure on why.

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Hmm maybe it's my capture method. I have mine set to Automatic
image

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Tried that and got the same visual results but different log results:

[zoom_and_follow_mouse_debug.py] Key 'monitor' does not exist in data
[zoom_and_follow_mouse_debug.py] Source name: Display Capture
[zoom_and_follow_mouse_debug.py] Source: 
[zoom_and_follow_mouse_debug.py] <Swig Object of type 'obs_source_t *' at 0x...>
[zoom_and_follow_mouse_debug.py] Source Settings: 
[zoom_and_follow_mouse_debug.py] <Swig Object of type 'obs_data_t *' at 0x...>
[zoom_and_follow_mouse_debug.py] OBS Data: 
[zoom_and_follow_mouse_debug.py] {"method":2}
[zoom_and_follow_mouse_debug.py] {'method': 2}

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

Well at least there's data now, some progress. I ran through the different capture methods on my end as well, but I'm getting back the exact same data, with only one value change.

[zoom_and_follow_mouse.py] Source: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_source_t *' at 0x000001F83679AFC0>
[zoom_and_follow_mouse.py] Source Settings: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_data_t *' at 0x000001F8558F3210>
[zoom_and_follow_mouse.py] OBS Data: 
[zoom_and_follow_mouse.py] {"capture_cursor":true,"method":2,"monitor":0,"monitor_wgc":0}
[zoom_and_follow_mouse.py] Source name: Display Capture
[zoom_and_follow_mouse.py] Source: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_source_t *' at 0x000001F83679AFC0>
[zoom_and_follow_mouse.py] Source Settings: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_data_t *' at 0x000001F8558F3120>
[zoom_and_follow_mouse.py] OBS Data: 
[zoom_and_follow_mouse.py] {"capture_cursor":true,"method":1,"monitor":0,"monitor_wgc":0}
[zoom_and_follow_mouse.py] Source name: Display Capture
[zoom_and_follow_mouse.py] Source: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_source_t *' at 0x000001F83679AFC0>
[zoom_and_follow_mouse.py] Source Settings: 
[zoom_and_follow_mouse.py] <Swig Object of type 'obs_data_t *' at 0x000001F8558F3120>
[zoom_and_follow_mouse.py] OBS Data: 
[zoom_and_follow_mouse.py] {"capture_cursor":true,"method":0,"monitor":0,"monitor_wgc":0}

At least on my end, I know that my monitors are being captured with this part of OBS: https://github.com/obsproject/obs-studio/blob/b94e960d253e5889a859f737120340d2da242bc2/plugins/win-capture/duplicator-monitor-capture.c
It's the only place monitor_wgc is ever mentioned. Maybe it's because my monitor/system is hdr capable that I get these results specifically.

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Possibly, but I'm still curious as to what the difference is between the libraries you use for this purpose in your latest script vs. the libraries used in the previous version here: https://github.com/tryptech/obs-zoom-and-follow/tree/68e1aef99cb2d55a60324e1ea9d48f92815f8949

If OBS can recognize my monitor using those libraries I'm wondering why not with this latest one? Is it doing something differently?

from obs-zoom-and-follow.

tryptech avatar tryptech commented on May 30, 2024

I changed dependencies so I could expand the zoom function to window capture as well. The issue though doesn't seem to be with the dependencies necessarily.

In the old version, it iterated through the list of monitors and checked if its name matched the selected monitor. Now, I'm getting the monitor info that OBS has from the selected source, and using that to key the list of monitors the system reports, match happens based on the ID between the two. I prefer this way in case there are other monitor devices in the system that potentially screw up ordering, and in the case that some window manager in Linux behaves a bit differently.

from obs-zoom-and-follow.

clarkio avatar clarkio commented on May 30, 2024

Ah I understand. That makes sense and seems like a safer way to go about this. I'm a bit stumped as to why OBS isn't reporting the monitor details for this. 🤷‍♂️ I'll keep trying to dig for an answer more over time and see if anything comes up

from obs-zoom-and-follow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.