TTrimpx

Automation Guide

OBS CLI Recording: Automate Your Streaming Workflow

Set up OBS for headless recording, automate scene switching, and manage replay buffers using command-line tools. Perfect for scheduled streams and automated content pipelines.

Why Use obs-cli?

  • Scheduled recordings — Record at specific times without manual intervention
  • Automated scene switching — Switch scenes based on triggers or time
  • Replay buffer management — Automatically capture highlights
  • Remote control — Control OBS from scripts and servers

Prerequisites

  1. Install OBS Studio — Download from obsproject.com
  2. Set up a scene collection — Create scenes for your different content types
  3. Install obs-cli — Available on GitHub for macOS, Windows, and Linux
  4. Configure OBS settings — Enable the HTTP server in Tools > obs-websocket server

Essential obs-cli Commands

Start Recording

obs-cli recording start
# or with custom output path:
obs-cli recording start --output "~/recordings/stream_$(date +%Y%m%d).mp4"

Switch Scenes

obs-cli scene switch "Main Camera"
obs-cli scene switch "Screen Share"

Stop Recording & Check Status

obs-cli recording status
# Output: "recording" or "not-recording"

obs-cli recording stop

Scheduled Recording (Bash)

#!/bin/bash
# Record for 30 minutes, then stop
obs-cli scene switch "Camera"
obs-cli recording start --output "auto_record.mp4"
sleep 1800
obs-cli recording stop --output "auto_record_complete.mp4"
echo "Recording complete at $(date)"

Recommended OBS Settings for Automated Recording

Output ModeAdvanced (not Simple)
Encoderx264 or NVENC (hardware accel)
Bitrate6,000–12,000 Kbps for recording
Keyframe Interval2 seconds (standard)
Profilehigh

Plan your OBS job faster. Trimpx's OBS preset generates the complete command sequence for your recording setup in seconds.

Related Trimpx Resources