Question / Help Window Capture and multiple homebrewed python apps

Trysdyn

New Member
I use OBS to stream gaming/speedruns, and have several apps I've written in Python that I use as part of my overlay. When I stream I have a button input visualizer and a chat overlay, both of which I wrote using the PyGame (SDL) lib.

This works fine, except since both apps are launched from c:\Python27\pythonw.exe, OBS will confuse them from time to time. Most notably seems to be if one of the apps fails (or I forget to launch it), OBS will panic and fall back to displaying the other in its place. It'll remain stuck this way until I either stop and restart the stream, or remove or re-add the application. In cases where things really go wrong, OBS will grab my Twitter client (which I also wrote myself, using the same libs), and start displaying my private Twitter account to the stream; very bad.

I presume this is because OBS logic searches for Window ID, then Title, then if a window matching those is not found, it falls back to executable name. Is this correct? Is there something I can manipulate either in my code, or OBS settings, to make OBS more able to identify which application is which? Failing that, what is OBS's logic for matching up which window is which? I'll try to find a workaround with that info in-hand.

The other option for me is to compile these apps into EXEs so they have completely different pathnames and OBS won't think they're the same, I guess, but that would ruin some of the flexibility my overlay system has.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
It searches for the Window class + title, if it can't find one where both match, then it searches for just the window class. It actually does not search by executable. It's an annoying situation, and I think there should be better ways of dealing with it, such as search terms, rather than full string matches.
 

Trysdyn

New Member
Window class... that makes sense. The SDL wrapper I use hard-codes the WMCLASS like a proper bad citizen. I hadn't thought of that until I inspected the windows I was creating and they all have a WMCLASS of "pygame".

Well nuts. Thanks for the info. I can probably apply a dodgy hack from here :)
 
Top