DEV Community

Stephane Bhiri
Stephane Bhiri

Posted on • Originally published at vajracast.com

OBS to SRT Streaming: Setup Guide for Low-Latency Broadcasting

Why Use SRT with OBS?

OBS Studio has supported SRT output since version 27, and as of version 30+ it is a first-class protocol option. If you are still pointing OBS at an RTMP endpoint, you are missing out on three significant upgrades:

  1. Encryption: SRT encrypts your stream with AES-128 or AES-256 natively. No RTMPS certificate management, no TLS overhead. Just a shared passphrase.
  2. Error recovery: SRT's selective retransmission (ARQ) recovers lost packets without retransmitting the entire stream. On a network with 2-5% packet loss, RTMP produces visible artifacts. SRT delivers a clean stream.
  3. Real-time diagnostics: SRT exposes metrics like RTT, packet loss, jitter, and retransmission count. Your receiving server can monitor stream health in real-time and react before problems become visible.

This guide covers everything you need to connect OBS to an SRT destination.

Prerequisites

Before starting:

  • OBS Studio 30 or newer. Older versions have SRT support but with fewer configuration options and known bugs. Update to the latest version.
  • An SRT destination: a server running an SRT listener.
  • UDP connectivity. SRT uses UDP. If you are behind a corporate firewall that blocks outbound UDP, you will need an exception for your SRT port.
# Quick test: can you reach your server on UDP?
nc -vz -u your-server.com 9000
Enter fullscreen mode Exit fullscreen mode

Step 1: Configure the SRT Destination

First, set up the receiving end. You need an SRT listener:

  1. Choose a port (e.g., 9000)
  2. Set latency to 500ms as a starting point
  3. Enable encryption with a strong passphrase and AES-256

Your SRT endpoint is now: srt://your-server.com:9000

If you want to test quickly, you can use FFmpeg as a listener:

ffmpeg -i "srt://0.0.0.0:9000?mode=listener&latency=500000" -c copy output.ts
Enter fullscreen mode Exit fullscreen mode

Step 2: Configure OBS Stream Settings

Open OBS and go to Settings > Stream:

  1. Service: Select Custom...
  2. Server: Enter your SRT URL with all parameters:
srt://your-server.com:9000?latency=500000&passphrase=YourSecurePassphrase&pbkeylen=32
Enter fullscreen mode Exit fullscreen mode
  1. Stream Key: Leave this empty. SRT does not use stream keys.

Critical: Latency Units

OBS specifies SRT latency in microseconds, not milliseconds. This is the single most common configuration mistake:

Desired Latency OBS Value
120ms 120000
500ms 500000
1000ms 1000000
2000ms 2000000

If you set latency=500 in OBS, you are requesting 0.5ms, effectively zero buffer.

The Full SRT URL Explained

srt://your-server.com:9000?mode=caller&latency=500000&passphrase=MyPass123&pbkeylen=32&oheadbw=25
Enter fullscreen mode Exit fullscreen mode
Parameter Value Description
mode caller OBS initiates the connection
latency 500000 500ms receive buffer in microseconds
passphrase MyPass123 Shared encryption passphrase (10-79 characters)
pbkeylen 32 AES-256 (16=AES-128, 24=AES-192, 32=AES-256)
oheadbw 25 25% overhead bandwidth for retransmissions

Step 3: Configure OBS Output Settings

Go to Settings > Output and switch to Advanced mode.

Encoder Settings

x264 (Software Encoding)

Encoder: x264
Rate Control: CBR
Bitrate: 6000 Kbps
Keyframe Interval: 2 seconds
CPU Usage Preset: veryfast
Profile: high
Tune: zerolatency
Enter fullscreen mode Exit fullscreen mode

The zerolatency tune disables x264's frame reordering and look-ahead features, reducing encoding latency by 2-5 frames.

NVENC (NVIDIA GPU)

Encoder: NVIDIA NVENC H.264
Rate Control: CBR
Bitrate: 6000 Kbps
Keyframe Interval: 2 seconds
Preset: P4
Profile: high
B-Frames: 0 (minimum latency) or 2 (better quality)
Enter fullscreen mode Exit fullscreen mode

Intel QSV

Encoder: QuickSync H.264
Rate Control: CBR
Bitrate: 6000 Kbps
Keyframe Interval: 2 seconds
Profile: high
Enter fullscreen mode Exit fullscreen mode

Why CBR?

SRT works best with Constant Bitrate encoding:

  1. Bandwidth prediction: SRT allocates overhead bandwidth as a percentage of the stream bitrate. With CBR, this is predictable.
  2. Packet scheduling: Constant bitrate produces evenly-spaced packets, which SRT can schedule efficiently.

Step 4: Resolution and Bitrate Guidelines

Resolution Frame Rate Minimum Bitrate Recommended Bitrate
1280x720 30 fps 2500 Kbps 4000 Kbps
1280x720 60 fps 3500 Kbps 5000 Kbps
1920x1080 30 fps 4000 Kbps 6000 Kbps
1920x1080 60 fps 6000 Kbps 8000 Kbps
3840x2160 30 fps 15000 Kbps 20000 Kbps

Step 5: Latency Tuning

Measuring Your Baseline

  1. Start streaming with latency=500000
  2. Observe the reported RTT for 5 minutes
  3. Note the average RTT and the peak RTT

Calculating Optimal Latency

Optimal Latency = 4 * Average RTT + 2 * (Peak RTT - Average RTT)
Enter fullscreen mode Exit fullscreen mode

Example: Average RTT = 40ms, Peak RTT = 65ms

Latency = 4 * 40 + 2 * (65 - 40) = 160 + 50 = 210ms
Enter fullscreen mode Exit fullscreen mode

Round up to 250ms. In OBS: latency=250000

Troubleshooting

"Failed to connect to server"

  1. Wrong port: double-check the port number
  2. Firewall blocking UDP: SRT uses UDP, not TCP
  3. Passphrase mismatch: SRT silently rejects wrong passphrases
  4. Server not listening: verify the SRT listener is running

Stream connects but video is broken

  1. Latency too low: increase SRT latency
  2. Keyframe interval too long: set to 2 seconds maximum

Intermittent freezing

  • Switch to a faster encoder preset
  • Use hardware encoding (NVENC, QSV)
  • Reduce resolution or frame rate

OBS SRT Quick Reference

Local Network (LAN)

srt://192.168.1.100:9000?latency=60000
Enter fullscreen mode Exit fullscreen mode

Same City

srt://server.example.com:9000?latency=250000&passphrase=YourPassphrase&pbkeylen=32
Enter fullscreen mode Exit fullscreen mode

Cross-Country

srt://server.example.com:9000?latency=800000&passphrase=YourPassphrase&pbkeylen=32&oheadbw=25
Enter fullscreen mode Exit fullscreen mode

International

srt://server.example.com:9000?latency=1500000&passphrase=YourPassphrase&pbkeylen=32&oheadbw=30
Enter fullscreen mode Exit fullscreen mode

For more on SRT fundamentals, read the full SRT vs RTMP comparison.

Top comments (0)