Talk to OBS through Python

BeauWest

Member
Hey fellows! I'm working on a script to automate some of my tasks with streaming through OBS. I was wondering, is there any way to talk to OBS through Python, win32com etc.

Any help would be great! I can't find any documentation for the OBS API really, is there a place I can go to look at that other than the source code?
 

Warchamp7

Forum Admin
The documentation for the API hasn't been written yet, for now you'll just have to use the source code as a reference
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
It currently requires compiling a C++ DLL to access the API. I hope to change that in the future though, or maybe someone else will before I get time to do it
 

BeauWest

Member
Awesome, that's what I needed to know, thank you sir!

All I'm trying to do is switch scenes, but having trouble finding an effective way to trigger keyboard shortcuts to change them.
 

BeauWest

Member
R1CH, absolutely, that's the method I'm using now. I'm trying though to trigger the hotkeys (or switch the scene) through Python. Basically my script is set up to use Python's win32com to check the currently active window. If it matches one of my games set up in the config file (sc2.exe, bf3.exe, etc), it triggers the hotkeys that the config file says.

I think I have it working, I was hoping for a smoother, more reliable way to do it than just triggering the hotkeys though!
 

BeauWest

Member
And actually, it looks like what I'm using (SendKeysCtypes) doesn't work with certain applications. Not sure if the app is picking up the keystrokes or what.
 

BeauWest

Member
I'm starting to think that keystrokes may not be a good way to go regardless. For example, say I want to assign CTRL+NUMPAD8 to happen whenever I switch out of the game. However, I'm Alt-tabbing and looking for the correct window. So OBS sees it as CTRL+NUMPAD8+ALT+TAB and doesn't know what to do with it.

Back to the drawing board. ^_^
 
Top