Skip to main content

A command line tool for controlling OBS Studio via the OBS WebSockets API

Project description

Introduction

A command line tool for controlling OBS Studio [1] via the OBS WebSockets API, designed for use with tools such as the Elgato Stream Deck, or any hardware tool where you can assign a command to a single button press.

Features

  • Start/Stop streaming, including enabling/disabling chat safety features

  • Mute/Unmute Microphone and Desktop Audio sources, including supporting custom audio sources

  • Scene switching

  • Live Safety mode to combat the effects of hate raids.

Installation

OBS Streamdeck CTL is written in Python, and is available via pip.

Requirements

Installing

Open a command prompt and type the following:

pip install obs-streamdeck-controls

Linux and Mac users may want to add the --user flag to install the package and its requirements to your user directories instead of the system directories.

Now check the Post Install instructions

Installing From Source

Obtaining Source code

Download the required release from the releases page or clone the git repository to obtain the main branch:

git clone https://github.com/djnrrd/obs_streamdeck_controls.git

Pre Installation

Register a new application on dev.twitch.com. Then edit the file src/obs_sd_controls/conf.py and update the CLIENT_ID variable with your own Client ID.

Installing

Change directory into the downloaded folder and install locally via pip. It is recommended that you use the --user flag to install in your user directory.:

cd obs_streamdeck_controls
pip install --user --use-feature=in-tree-build .

Post Install

Windows

You will likely see a WARNING message, similar to the following

WARNING: The script obs-streamdeck-ctl.exe is installed in 'C:\Users\%USERNAME%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3 .9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts' which is not on PATH

Add this to your path with the following command:

setx PATH "C:\Users\%USERNAME%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts;%PATH%"

Make sure that you copy and paste the path from your error message, and ensure that ;%PATH% is added to the end

Restart your computer to make sure that the %PATH% is loaded correctly

Linux

If you installed with the --user flags, the command line program obs-streamdeck-ctl will be installed to your $HOME/.local/bin folder. Add:

PATH=$PATH:$HOME/.local/bin

to your .bashrc file, if you haven’t already.

Using

Initial Setup

After installing OBS Streamdeck Controls you will need to provide information regarding your OBS WebSockets password, names of your Microphone, Desktop, and alert overlay sources, authorise the application with twitch, and set your safety options.

Run the following command on a terminal/command line to launch a setup wizard:

obs-streamdeck-ctl setup

Using the Scripts

All scripts are launched by the same command line program:

obs-streamdeck-ctl SCRIPT_NAME

Where SCRIPT_NAME is one of the following:

start_stop

Start or Stop live streaming, and if Twitch chat safety features are enabled, toggle these. Safety features may put chat into Subscriber or Follower only mode and optionally switch Emote only mode on.

Because the Subscriber, Follower, and Emote only modes function like a toggle switch, If you enable any of these modes when live and don’t disable them before using this function to stop the stream, it may disable that mode when you are offline.

mute_mic

Toggle the mute function on your Microphone input source. If you use a different Microphone source to the default you can select that with the setup wizard.

mute_desk

Toggle the mute function on your Desktop Audio input source. If you use a different Desktop Audio source to the default you can select that with the setup wizard.

mute_all

Toggle the mute function on both the Desktop and Microphone Audio sources

scene X

Switch to Scene X in OBS Studio. X is the number of the Scene in the Scene List, counting down from the top and starting with 1.

live_safety

Sadly, people have taken to “Hate Raids” on Twitch, where your chat can be overwhelmed with hateful messages from multiple bot accounts. These bot accounts will also mass follow the channel, to queue up repeated alerts from any sound/screen alert web overlay services.

Live Safety can enable and disable Subscriber or Follower only mode in chat and optionally enable and disable Emote only mode.

Live Safety can also enable and disable sound/screen alert web overlay services, as well as any other web overlay services that you may use, like chat.

Like the start_stop function, enabling and disabling the chat modes and web overlay services is like a toggle function. So ending a stream before running Live Safety again could leave your web overlay services disabled.

setup

Launch the setup wizard, see Initial Setup for details

Footnotes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

obs_streamdeck_controls-0.2.4-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file obs_streamdeck_controls-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for obs_streamdeck_controls-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 80bc1028690a1bb31dd0b85416f8b9b8bbeb8ceaafba8aacb3f8e7618f234707
MD5 c5d2e5826752b4101569f3375edeb214
BLAKE2b-256 59bb29dfbf813ee147406ecce475781ed711cc9ac79184314e8d98d9f29da7ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page