OBS Studio
Control OBS Studio via obs-websocket with full support for scenes, sources, filters, streaming, recording, and more.
Overview
FaustBot connects to OBS Studio using the obs-websocket protocol (v5), providing:
Scene Control
Switch scenes, get scene list, studio mode.
Source Control
Show/hide sources, get source settings.
Filter Control
Enable/disable filters, adjust settings.
Audio Control
Mute/unmute, adjust volume, monitor types.
Stream/Record
Start/stop streaming and recording.
Multi-Instance
Connect to multiple OBS instances.
Setup
Enable OBS WebSocket
OBS 28+ has WebSocket built-in. For older versions, install the obs-websocket plugin.
Open OBS WebSocket Settings
In OBS, go to Tools → WebSocket Server Settings.
Enable and Configure
Enable the WebSocket server and note the port (default: 4455). Set a password for security.
Connect from FaustBot
In FaustBot, go to OBS in the sidebar. Enter the host
(usually localhost), port, and password. Click Connect.
Auto-Connect
Enable Auto-Connect to automatically connect when FaustBot starts. Make sure OBS is already running when FaustBot launches.
Multiple OBS Instances
FaustBot supports connecting to multiple OBS instances simultaneously. This is useful for multi-PC streaming setups or controlling a separate "camera OBS" instance.
Add Connection
Click Add Connection in the OBS settings. Give it a descriptive name like "Main OBS" or "Camera PC".
Configure Each Connection
Enter the host, port, and password for each OBS instance. Remote connections use the IP address instead of localhost.
Set Default
Mark one connection as the default. Effects and triggers will use the default connection unless you specify otherwise.
Targeting Specific Connections
In your actions and scripts, you can target a specific OBS connection by name. This allows you to control different OBS instances from the same action.
Triggers
Respond to events from OBS:
Scene Changed Current scene changedStreaming Started Stream went liveStreaming Stopped Stream endedRecording Started Recording beganRecording Stopped Recording endedReplay Buffer Saved Replay saved to fileVirtual Cam Started Virtual camera activatedVirtual Cam Stopped Virtual camera deactivatedSource Visibility Changed Source was shown or hiddenEffects
Scene Control
Set Scene
Switch to a specific scene.
Set Preview Scene
Set preview scene (studio mode).
Trigger Transition
Trigger the transition in studio mode.
Source Control
Show Source
Make a source visible.
Hide Source
Make a source invisible.
Toggle Source
Toggle source visibility.
Set Source Transform
Change position, scale, rotation.
Filter Control
Enable Filter
Turn on a filter.
Disable Filter
Turn off a filter.
Set Filter Settings
Modify filter parameters.
Audio Control
Mute Source
Mute an audio source.
Unmute Source
Unmute an audio source.
Set Volume
Set source volume level.
Set Monitor Type
Change audio monitoring.
Streaming & Recording
Start Streaming
Start the stream.
Stop Streaming
Stop the stream.
Start Recording
Start recording.
Stop Recording
Stop recording.
Save Replay Buffer
Save current replay buffer.
Scripting API
Control OBS from your scripts using the CPH API:
Scene Control
# Switch scene
CPH.ObsSetScene("Gaming")
# Get current scene
scene = CPH.ObsGetCurrentScene()
# Get all scenes
scenes = CPH.ObsGetScenes()Source Control
# Show a source
CPH.ObsShowSource("Gaming", "Webcam")
# Hide a source
CPH.ObsHideSource("Gaming", "Webcam")
# Check if source is visible
visible = CPH.ObsIsSourceVisible("Gaming", "Webcam")Filter Control
# Enable a filter
CPH.ObsSetSourceFilterState("Webcam", "Color Correction", True)
# Disable a filter
CPH.ObsSetSourceFilterState("Webcam", "Color Correction", False)Audio Control
# Mute/unmute
CPH.ObsSetMute("Mic/Aux", True) # Mute
CPH.ObsSetMute("Mic/Aux", False) # Unmute
# Set volume (0.0 to 1.0)
CPH.ObsSetVolume("Desktop Audio", 0.5)Streaming & Recording
# Stream control
CPH.ObsStartStreaming()
CPH.ObsStopStreaming()
# Recording control
CPH.ObsStartRecording()
CPH.ObsStopRecording()
# Check status
is_streaming = CPH.ObsIsStreaming()
is_recording = CPH.ObsIsRecording()Targeting Specific Connections
# Target a named connection
CPH.ObsSetScene("Gaming", connection="Camera OBS")
# Or by index (0-based)
CPH.ObsSetScene("Gaming", connectionIdx=1)See the full API reference for all available OBS methods.