OBS plugins
Overview
Section titled OverviewJust writing some notes as I create my code-jam project, so these may not be relevant here by the end.
Getting started
Section titled Getting startedPaths on macOS:
- Install location:
~/Library/Application Support/obs-studio/plugins
- Log location
~/Library/Application Support/obs-studio/logs
You can open another instance of OBS while one is already running with this command on macOS:
Setting up live captioning
Section titled Setting up live captioning- Install this plugin
- I downloaded the prebuilt version from the releases
- I tried to use this in a second instance of OBS, but it froze everything and I had to force-quit OBS
- Make sure to add the LocalVocal filter to your mic. Here are the settings that I configured:
Python scripting
Section titled Python scriptingGetting started with Python
Section titled Getting started with Python- The documentation mentions that your Python version needs to match the OBS architecture, but it doesn’t tell you how to find the Python version that OBS uses. I tried 3.9 and 3.12 and neither worked, but 3.11 worked (as of Wed 02/07/2024). It looks like it should match the versions listed here.
- The final path that I used is
/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks
. I installed Python viabrew install python@3.11
.
- The final path that I used is
- You get access to all of the APIs via importing
obspython
, e.g.import obspython as S
.- Don’t trust the results of
dir
to explore the API! - There is no Python-specific API reference; just look at the C reference instead. Alternatively, look at this cheat-sheet repo, e.g. this script, which produces this UI:
- As you can see, the script allows you to choose the scene name from a dropdown and then set it.
- Re-run a script with the “refresh” button:
- Don’t trust the results of
Note: at one point, I did a brew upgrade
and then Python could no longer be loaded in OBS. To fix this, I had to install the specific version that I’d been trying to use via pyenv
(reference):
brew update
brew install pyenv
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.11.7
- Select Python version globally:
pyenv global 3.11.7
- Figure out where the framework folder is:
pyenv root
- This outputs something like
/Users/adam/.pyenv
, which means you can find your framework in/Users/adam/.pyenv/versions/3.11.7/Library/Frameworks
.
- This outputs something like
- Just make sure that you tell your shell to use
pyenv
’s path by putting this in your shell’s rc file:eval "$(pyenv init -)"
Troubleshooting
Section titled Troubleshootingscript_load
isn’t being called
Section titled script_load isn’t being calledIt appears to only be called when you actually have settings to load. When you don’t have settings, just make a main
function like you would in a regular script.
OBS seems to crash/hang
Section titled OBS seems to crash/hangMake sure you’re spawning processes asynchronously. I had this code:
…and it would launch my program, but it would hang after that without switching scenes (until I closed the program). The fix was to call subprocess.Popen
.