Recording & Streaming
This guide covers every OBS output: recording (including split files and chapter markers), streaming, the virtual camera, the replay buffer (with filename collision-proofing), generic output control, and stream captions.
Recording
| Function | Description |
|---|---|
StartRecord() | Start recording |
StopRecord() | Stop recording |
PauseRecord() | Pause recording |
ResumeRecord() | Resume recording |
ToggleRecord() | Toggle recording state |
ToggleRecordPause() | Toggle recording pause state |
GetRecordStatus() | Fetch current recording status |
IsRecording() | Check if currently recording |
Record Directory
| Function | Description |
|---|---|
GetRecordDirectory() | Fetch current record directory (async) |
SetRecordDirectory(Directory) | Set record directory (takes effect on next recording) |
GetCachedRecordDirectory() | Get cached directory value |
Note:
SetRecordDirectorychanges take effect on the NEXT recording start, not immediately.
Record Split & Chapters (OBS 30.2+ / obs-websocket 5.5.0+)
| Function | Description |
|---|---|
SplitRecordFile() | Split current recording into a new file |
CreateRecordChapter(ChapterName) | Add chapter marker to recording (optional name) |
Requirements:
- OBS 30.2.0 or later
- obs-websocket 5.5.0 or later
- Must be actively recording
- Chapter markers only work with Hybrid MP4 recording format
Streaming
| Function | Description |
|---|---|
StartStream() | Start streaming |
StopStream() | Stop streaming |
ToggleStream() | Toggle streaming state |
GetStreamStatus() | Fetch current stream status |
IsStreaming() | Check if currently streaming |
Virtual Camera
| Function | Description |
|---|---|
StartVirtualCam() | Start virtual camera |
StopVirtualCam() | Stop virtual camera |
ToggleVirtualCam() | Toggle virtual camera |
GetVirtualCamStatus() | Fetch current virtual camera status |
IsVirtualCamActive() | Check if active |
Replay Buffer
| Function | Description |
|---|---|
StartReplayBuffer() | Start replay buffer |
StopReplayBuffer() | Stop replay buffer |
ToggleReplayBuffer() | Toggle replay buffer state |
SaveReplayBuffer() | Save current buffer to file |
GetReplayBufferStatus() | Fetch current replay buffer status |
IsReplayBufferActive() | Check if active |
GetLastReplayPath() | Get file path of last saved replay |
Note: Enable the replay buffer in OBS Settings → Output → Replay Buffer first!
Filename collision-proofing (opt-in)
OBS names replay files by timestamp, so rapid saves can overwrite each other. The Outputs handler can rename each saved file automatically and tag it with an in-engine label. These live on GetClient()->GetOutputs():
| Function | Description |
|---|---|
SetReplayCollisionProofing(bEnable) | Append a millisecond-precise suffix to each saved replay so files never collide |
SetNextReplayContextLabel(Label) | Tag the next save with a sanitized label (e.g. "BossKill") embedded in the filename |
SaveReplayBufferWithContext(Label) | Save the buffer now with a one-shot context label |
GetLastReplayPath() reports the final (renamed) path. If OBS wrote the file on a different machine, the rename is skipped and the original path is kept.
Generic Output Control
Control any OBS output by name, including custom and plugin outputs.
| Function | Description |
|---|---|
GetOutputList() | Fetch all available outputs (async) |
GetOutputStatus(OutputName) | Get status of specific output |
GetOutputSettings(OutputName) | Get settings of output |
SetOutputSettings(OutputName, Settings) | Set output settings (C++ version) |
SetOutputSettingsFromString(OutputName, JsonSettings) | Set output settings (Blueprint-friendly) |
StartOutput(OutputName) | Start specific output |
StopOutput(OutputName) | Stop specific output |
ToggleOutput(OutputName) | Toggle output on/off |
GetCachedOutputs() | Get cached output list |
Note: Output names are internal OBS names which may differ from display names. Use
GetOutputList()to discover available outputs.
Stream Captions
| Function | Description |
|---|---|
SendStreamCaption(CaptionText) | Send CEA-608 caption text over stream |
Requirements:
- Stream must be active
- Sends closed captions in CEA-608 format
Output Events
OnStreamStateChanged(bActive, State): Fires when the streaming state changes.OnRecordStateChanged(bActive, State): Fires when the recording state changes.OnVirtualCamStateChanged(bActive, State): Fires when the virtual camera state changes.OnReplayBufferStateChanged(bActive, State): Fires when the replay buffer state changes.OnReplayBufferSaved(FilePath): Fires when a replay is saved to file.OnRecordFileChanged(NewOutputPath): Fires when recording begins writing to a new file after a split.OnRecordDirectoryReceived(RecordDirectory): Fires when the record directory is fetched.OnOutputListReceived(Outputs): Fires when the output list is fetched.OnOutputStatusReceived(Status): Fires when an output status is fetched.
For the full catalog of events across every OBS domain, see the Events reference.