OBS Studio
Included with Macro DeckSwitch scenes, control your stream, recording and audio, and react to what happens in OBS Studio.
The Connect OBS Studio dialog with the configuration name, host, port and password
- Switch scenes, profiles and scene collections
- Start and stop streaming, recording, replay buffer and virtual camera
- Mute inputs, set volumes and toggle sources and filters
- Live variables for scenes, timecodes, FPS and dropped frames
- Connect several OBS instances at once
The OBS Studio integration connects Macro Deck to OBS through the WebSocket server that is built into OBS (obs-websocket 5). Once it is connected, your buttons can control almost everything you do in OBS during a stream, and OBS reports back what changes so your deck always shows the current state.
What you can do
- Switch the program scene, the studio-mode preview scene, the profile or the scene collection.
- Start, stop or toggle streaming, recording, the replay buffer and the virtual camera, save a replay, pause a recording, split the recording file or add a chapter marker.
- Show or hide a source in a scene, enable or disable a filter, mute an input or change its volume in percent or dB.
- Change a setting of a source, for example the text of a text source, the file of an image or media source, or the URL of a browser source.
- Start and stop any OBS output by name, including outputs that plugins add.
Some example setups:
- A BRB button that switches to your BRB scene and mutes your microphone.
- A Record button that toggles recording and shows whether OBS is recording, paused or stopped.
- A slider bound to the
obs_<input>_volumevariable of your music input, so moving the slider changes the volume in OBS. - A flow that runs when OBS reports Streaming Started and sends you a notification.
How it behaves
Macro Deck listens to the events OBS sends, so variables such as the current scene, mute states and filter states update within a fraction of a second after you change them in OBS. Toggle buttons light up while their state is active, also when you change it in OBS itself. Statistics like FPS, CPU usage, bitrate and dropped frames are read every one or two seconds.
Besides the fixed variables, the variable picker lists each input, scene, scene item and filter of the connected OBS, with its volume, mute state, visibility or enabled state. Triggers react to scene changes, recording and streaming changes, saved replays and screenshots, inputs becoming active, and custom events that your own OBS scripts broadcast.
You can add more than one configuration, for example one for your streaming PC and one for your gaming PC. Each configuration gets its own set of variables, and every action has a Configuration field to choose which OBS it controls. When OBS closes or the network drops, Macro Deck keeps trying to reconnect and fires Disconnected and Connected triggers.
What you need
- Macro Deck 3 on Windows, macOS or Linux
- OBS Studio 28 or newer (includes obs-websocket 5)
- The WebSocket server turned on in OBS under Tools > WebSocket Server Settings
- Starting and stopping outputs by name needs obs-websocket 5.7 or newer
Set it up
Step 1: Turn on the WebSocket server in OBS
In OBS, open Tools > WebSocket Server Settings and check Enable WebSocket server. Note the Server Port (default
4455). If Enable Authentication is checked, click Show Connect Info to see the password.Step 2: Open OBS Studio in Macro Deck
In Macro Deck, click Integrations in the sidebar and click OBS Studio. On the Overview tab, click Add configuration in the Configuration section. Turning on the switch at the top right opens the same dialog, and the integration is turned on once the setup is done.
Step 3: Enter the connection details
Fill in the dialog Connect OBS Studio:
- Configuration name: a name you choose, for example
Streaming PC. - Host:
127.0.0.1when OBS runs on the same computer, otherwise the IP address of the computer running OBS. - Port: the server port from OBS,
4455by default. - Password: the password from OBS. Leave it empty if authentication is turned off.
Click Continue. Macro Deck tests the connection before it saves the configuration.
- Configuration name: a name you choose, for example
Step 4: Add an OBS action to a button
On the Deck page, click the button you want to use. The deck must be unlocked: when the button at the top right reads Lock, it is unlocked. The editor opens with Short Press selected. Click + Add action, select OBS Studio on the left of the Add action dialog and pick an action such as Set Scene. Select the Configuration and the Scene, then click Save.
Step 5: Press the button
Press the button on your phone, tablet or in the web client. OBS switches to the scene you picked. If nothing happens, check that OBS is running and that the configuration shows Connected on the OBS Studio page under Integrations.
Actions35
Put these on a button or run them from a flow.
- Set Scene
- Switches the active program scene.
- Set Preview Scene
- Switches the studio-mode preview scene.
- Set Profile
- Switches OBS to another profile.
- Set Scene Collection
- Switches OBS to another scene collection.
- Start Recording
- Starts recording.
- Stop Recording
- Stops recording.
- Toggle Recording
- Starts or stops recording, and shows whether OBS is recording, paused or stopped.
- Pause/Resume Recording
- Pauses or resumes the current recording.
- Start Streaming
- Starts the stream.
- Stop Streaming
- Stops the stream.
- Toggle Streaming
- Starts or stops the stream.
- Start Virtual Camera
- Starts the virtual camera.
- Stop Virtual Camera
- Stops the virtual camera.
- Toggle Virtual Camera
- Starts or stops the virtual camera.
- Start Replay Buffer
- Starts the replay buffer.
- Stop Replay Buffer
- Stops the replay buffer.
- Toggle Replay Buffer
- Starts or stops the replay buffer.
- Save Replay Buffer
- Saves the current replay buffer to disk.
- Split Recording File
- Starts a new recording file while the recording keeps running.
- Create Recording Chapter
- Adds a chapter marker to the file being recorded (Hybrid MP4 format only).
- Set Recording Directory
- Sets the folder OBS writes new recordings to.
- Start Output
- Starts an OBS output by name, including outputs added by plugins.
- Stop Output
- Stops an OBS output by name, including outputs added by plugins.
- Toggle Output
- Starts or stops an OBS output by name, including outputs added by plugins.
- Get Output State
- Reads whether an OBS output is active into a variable.
- Set Source Visibility
- Shows, hides or toggles a source in a scene.
- Mute Input
- Mutes, unmutes or toggles an audio input.
- Set Input Volume
- Sets, increases or decreases the volume of an audio input in percent or dB.
- Set Source Filter
- Enables, disables or toggles a filter on a source.
- Set Input Setting
- Changes one setting of a source, for example the text of a text source or the URL of a browser source.
- Get Input Volume
- Reads the volume percentage of an audio input into a variable.
- Get Filter State
- Reads whether a source filter is enabled into a variable.
- Get Input Mute State
- Reads whether an audio input is muted into a variable.
- Get Source Visibility
- Reads whether a source is visible in a scene into a variable.
- Toggle Studio Mode
- Turns studio mode on or off.
Triggers24
A button or flow can react to these events.
- Scene Changed
- The program (live) scene changed. Optionally only for one scene.
- Preview Scene Changed
- The studio-mode preview scene changed.
- Recording Started
- OBS started recording.
- Recording Stopped
- OBS stopped recording.
- Recording Paused
- The recording was paused.
- Recording Resumed
- The recording was resumed.
- Recording File Changed
- The recording started, moved to a new file or stopped, with the file path.
- Streaming Started
- OBS started streaming.
- Streaming Stopped
- OBS stopped streaming.
- Replay Buffer Started
- The replay buffer started.
- Replay Buffer Stopped
- The replay buffer stopped.
- Replay Buffer Saved
- A replay clip was written to disk, with its file path.
- Screenshot Saved
- OBS saved a screenshot to disk, with its file path.
- Virtual Camera Started
- The virtual camera started.
- Virtual Camera Stopped
- The virtual camera stopped.
- Studio Mode Changed
- Studio mode was turned on or off.
- Input Mute Changed
- An audio input was muted or unmuted. Optionally only for one input.
- Input Became Active
- An input started rendering in the program output, for example a webcam going live.
- Input Became Inactive
- An input stopped rendering in the program output.
- Input Started Showing
- An input started rendering in the program or the preview output.
- Input Stopped Showing
- An input is no longer rendered in the program or the preview output.
- Custom Event
- An OBS script or plugin broadcast a custom event. Optionally only for one event name.
- Connected
- Macro Deck connected to OBS and OBS finished loading.
- Disconnected
- The connection to OBS was lost.
Variables14
Show these values on buttons and widgets, or use them in conditions.
obs_<configuration>_is_connected- Whether Macro Deck is connected to this OBS.
obs_<configuration>_current_scene- The active program scene.
obs_<configuration>_preview_scene- The studio-mode preview scene.
obs_<configuration>_current_profile- The active profile.
obs_<configuration>_current_scene_collection- The active scene collection.
obs_<configuration>_is_recording,obs_<configuration>_recording_paused,obs_<configuration>_recording_timecode- Whether OBS is recording or paused, and how long the recording runs.
obs_<configuration>_is_streaming,obs_<configuration>_streaming_timecode- Whether OBS is streaming and for how long.
obs_<configuration>_virtual_camera_active,obs_<configuration>_replay_buffer_active,obs_<configuration>_studio_mode_active- Whether the virtual camera, the replay buffer and studio mode are on.
obs_<configuration>_fps,obs_<configuration>_max_fps,obs_<configuration>_cpu_usage- Performance figures that OBS reports.
obs_<configuration>_streaming_bitrate,obs_<configuration>_recording_bitrate- The current output bitrates in kbps.
obs_<configuration>_dropped_frames,obs_<configuration>_dropped_frames_percent,obs_<configuration>_skipped_frames,obs_<configuration>_skipped_frames_percent- Dropped frames of the stream and frames skipped by the encoder, as counts and in percent.
obs_<configuration>_last_recording_file,obs_<configuration>_last_screenshot- The path of the latest recording file and screenshot.
obs_<input>_volume,obs_<input>_mutedand more- For each input you pick: volume in dB (writable, so a slider can set it), muted, active, showing, audio tracks (
obs_<input>_track_1to_6), monitor type, sync offset and its settings. The picker suggests these names, and you can change them. obs_<scene>_<source>_visible,obs_<source>_<filter>_enabled- Whether a source is visible in a scene and whether a filter is enabled. The picker suggests these names, and you can change them.
Frequently asked questions
Does it work when OBS runs on another computer?
Yes. Enter the IP address of the computer running OBS as Host, and allow the port (4455 by default) through that computer's firewall. Paths in actions like Set Recording Directory or Set Input Setting are paths on the computer that runs OBS.
Can I control more than one OBS?
Yes. Add one configuration per OBS instance with Add configuration. Each one has its own variables, and each action has a Configuration field to pick the OBS it controls.
What happens when OBS closes or the connection drops?
Macro Deck keeps trying to reconnect in the background and connects again once OBS is back. Actions fail with OBS is not connected. until then, and the Disconnected and Connected triggers fire so a flow can react.
Why does an action fail?
The action shows the reason, for example that a scene or source no longer exists, that OBS is still loading a scene collection, or that OBS is not recording (for Split Recording File and Create Recording Chapter). If you renamed something in OBS, pick it again in the action.
Where is the WebSocket password stored?
Macro Deck stores the password encrypted on the computer that runs Macro Deck and only uses it to connect to OBS.
More in Streaming
Meld Studio
Included with Macro DeckSwitch and stage scenes, control layers, effects and audio tracks, and go live in Meld Studio.
Streamlabs Desktop
Included with Macro DeckSwitch scenes, control your stream, recording and audio sources in Streamlabs Desktop.
Streamer.bot
Included with Macro DeckRun Streamer.bot actions, send chat messages and react to every event Streamer.bot reports.
Twitch
Included with Macro DeckShow your Twitch chat and stream stats, moderate, run polls and ads, and react to follows, subs and raids.
YouTube
Included with Macro DeckShow your YouTube live chat and stream stats, change title and tags, and react to Super Chats and members.