Skip to content

SRT Protocol

SRT (Secure Reliable Transport) is an open-source low-latency transport protocol developed by Haivision. It provides secure, reliable data transmission over unreliable networks, making it particularly suitable for remote contribution, broadcast-grade ingest, and other scenarios with high network jitter resilience requirements.

PropertyValue
Default Port6000
Transport LayerUDP (SRT protocol layer)
Publish✅ Supported
Subscribe✅ Supported
Latency120ms+ (configurable)
Feature Flagsrt
Cargo.toml
[features]
srt = ["dep:plugin-srt", "plugin-srt/srt", "srt-tokio"]
srt:
enable: true
listen_addr: ":6000"
latency_ms: 120
max_bandwidth: 0
passphrase: null
OptionTypeDefaultDescription
enablebooltrueWhether to enable the SRT plugin
listen_addrstring":6000"Listen address
latency_msu32120Transport latency (milliseconds)
max_bandwidthu640Maximum bandwidth (bytes/sec, 0=unlimited)
passphraseOptionnullEncryption passphrase (10-79 characters)

latency_ms is the core SRT parameter that controls the buffer latency from sender to receiver:

  • Low-latency scenarios (LAN): 60-120ms
  • City-level transport: 120-500ms
  • Cross-country transport: 500-2000ms

SRT supports AES encryption, configured via passphrase:

srt:
passphrase: "my-secret-key-12345"

The passphrase must be between 10 and 79 characters. Both the publisher and subscriber must use the same passphrase.

Terminal window
# Basic publish
ffmpeg -re -i input.mp4 -c copy -f mpegts "srt://localhost:6000?streamid=publish/live/test"
# Publish with encryption
ffmpeg -re -i input.mp4 -c copy -f mpegts \
"srt://localhost:6000?streamid=publish/live/test&passphrase=my-secret-key-12345"
# Specify latency parameter
ffmpeg -re -i input.mp4 -c copy -f mpegts \
"srt://localhost:6000?streamid=publish/live/test&latency=200000"
# Camera capture and publish
ffmpeg -f v4l2 -i /dev/video0 \
-c:v libx264 -preset ultrafast -tune zerolatency \
-c:a aac -b:a 128k \
-f mpegts "srt://localhost:6000?streamid=publish/live/camera"
  1. Go to SettingsStream
  2. Select Custom for the service
  3. Enter the server URL: srt://your-server:6000?streamid=publish/live/test
  4. Click Start Streaming

SRT uses the streamid parameter to distinguish between publishing and subscribing:

  • Publish: streamid=publish/{streamPath}
  • Subscribe: streamid=subscribe/{streamPath} or streamid=play/{streamPath}
Terminal window
ffplay "srt://localhost:6000?streamid=subscribe/live/test"
Terminal window
ffmpeg -i "srt://localhost:6000?streamid=subscribe/live/test" -c copy output.mp4
  1. Open VLC, select MediaOpen Network Stream
  2. Enter URL: srt://localhost:6000?streamid=subscribe/live/test
  3. Click Play

Streams published via SRT can be played back through other protocols:

Terminal window
# SRT publish
ffmpeg -re -i input.mp4 -c copy -f mpegts \
"srt://localhost:6000?streamid=publish/live/test"
# Subscribe via RTMP
ffplay rtmp://localhost:1935/live/test
# Subscribe via HTTP-FLV
ffplay http://localhost:8080/flv/live/test.flv
# Subscribe via HLS
ffplay http://localhost:8080/hls/live/test/index.m3u8
FeatureSRTRTMP
Transport LayerUDPTCP
LatencyConfigurable (120ms+)1-3 seconds
Lossy Network ResilienceStrong (FEC + ARQ)Weak
EncryptionAES encryptionNo built-in encryption
Firewall FriendlyModerate (UDP)Good (TCP)
Tool SupportFFmpeg/OBS/vMixWidespread

SRT significantly outperforms RTMP on lossy networks. It is recommended to use SRT instead of RTMP in the following scenarios:

  • Remote contribution over the public internet
  • Mobile network publishing
  • Environments with unstable network quality