Skip to content

OBS plugins

Just writing some notes as I create my code-jam project, so these may not be relevant here by the end.

Paths 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:

Terminal window
open -n -a OBS.app --args -multi
  • 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:
      • Pasted image 20240207110622.png
  • 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 via brew install python@3.11.
  • 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:
      • 700
      • 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:
      • 700

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.
  • 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 -)"

It 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.

Make sure you’re spawning processes asynchronously. I had this code:

def launch_program_and_switch_scene():
# Launch a program
subprocess.run([...])
set_scene_by_name("Some other scene")

…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.