DEV Community

Stephane Bhiri
Stephane Bhiri

Posted on • Originally published at vajracast.com

RTMP to SRT Migration: Complete Step-by-Step Guide

Why Migrate from RTMP to SRT?

RTMP was designed for a different internet. SRT was built for unreliable networks with UDP transport, selective retransmission (ARQ), and built-in AES encryption.

What you gain:

  • Built-in encryption: AES-128 or AES-256, native to the protocol
  • Lower latency: UDP avoids TCP head-of-line blocking
  • Better error recovery: tolerates up to 30% packet loss
  • Real-time diagnostics: RTT, jitter, packet loss, bandwidth estimation
  • Bonding: SRTLA aggregates multiple connections

Before You Start

Inventory Your RTMP Endpoints

List every ingest point and output destination.

Check Encoder SRT Support

Encoder SRT Support
OBS Studio Yes (v27+)
vMix Yes
Wirecast Yes (v14+)
FFmpeg Yes
BELABOX Yes + SRTLA
Older hardware Often no

Encoders without SRT need protocol conversion at the gateway.

Check Your Network

SRT uses UDP. Most corporate firewalls block it by default:

# Server side
nc -u -l 9000
# Encoder side
echo "test" | nc -u your-server.com 9000
Enter fullscreen mode Exit fullscreen mode

Step 1: Set Up Your SRT Gateway

Use a gateway as the central conversion point. Migrate one encoder at a time.

  1. Create SRT Listener on port 9000
  2. Set latency based on network path (60ms LAN to 3000ms cellular)
  3. Enable AES-256 encryption

Step 2: Configure OBS for SRT

srt://your-server:9000?latency=500000&passphrase=YourPassphrase&pbkeylen=32
Enter fullscreen mode Exit fullscreen mode

OBS uses microseconds: 500ms = 500000.

Output settings: CBR, 6000 Kbps, keyframe 2s, zerolatency tune.

Step 3: Configure FFmpeg

ffmpeg -i input.mp4 \
  -c:v libx264 -b:v 6000k -g 60 \
  -c:a aac -b:a 128k \
  -f mpegts \
  "srt://your-server:9000?mode=caller&latency=500000&passphrase=YourPassphrase&pbkeylen=32"
Enter fullscreen mode Exit fullscreen mode

Key: -f mpegts because SRT uses MPEG-TS, not FLV.

Step 4: Keep RTMP Outputs Where Needed

YouTube, Twitch, Facebook still require RTMP. Your gateway converts:

Encoder -> SRT (encrypted) -> Gateway -> RTMP -> YouTube/Twitch
                                       -> SRT  -> Production
                                       -> SRT  -> Recording
Enter fullscreen mode Exit fullscreen mode

Step 5: Set Up Failover

With SRT real-time health metrics, detect degradation before full failure:

  • Packet loss: switch at >5% sustained for 2 seconds
  • Timeout: switch after 500ms of no data
  • Bitrate floor: switch if below 50% expected

Validation Checklist

  • [ ] SRT connection establishes
  • [ ] Encryption active (AES-256)
  • [ ] No unrecovered packet loss
  • [ ] Video plays cleanly on all outputs
  • [ ] Audio in sync
  • [ ] Failover tested
  • [ ] 4-hour duration test passed

Migration Timeline

Week Action
1 Audit RTMP setup
2 Deploy SRT gateway, test
3 Migrate first encoder, run parallel
4 Validate, test failover
5 Migrate remaining encoders
6 Decommission RTMP ingest points

Migrate in parallel, not in-place. Run SRT alongside RTMP until confident.

More: SRT vs RTMP comparison | SRT Setup Guide

Top comments (0)