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
- Install OBS Studio — Download from obsproject.com
- Set up a scene collection — Create scenes for your different content types
- Install obs-cli — Available on GitHub for macOS, Windows, and Linux
- 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 Mode | Advanced (not Simple) |
| Encoder | x264 or NVENC (hardware accel) |
| Bitrate | 6,000–12,000 Kbps for recording |
| Keyframe Interval | 2 seconds (standard) |
| Profile | high |
- Set the right bitrate for your stream: OBS Settings Calculator
- Pick your output format: Format Conversion Guide
- Optimize quality with CRF values: CRF Calculator
Plan your OBS job faster. Trimpx's OBS preset generates the complete command sequence for your recording setup in seconds.