How to Stream SRT with Redundant Links in FFmpeg

This article provides a quick, practical guide on how to configure FFmpeg to stream video using Secure Reliable Transport (SRT) over redundant network connections. By leveraging SRT’s connection bonding capabilities (available in SRT v1.5 and later), you can prevent stream drops and buffer issues by distributing or duplicating your broadcast across multiple network interfaces, such as Ethernet and Wi-Fi or cellular.

Understanding SRT Connection Bonding

SRT connection bonding allows you to group multiple network links into a single logical stream. To use this in FFmpeg, your FFmpeg build must be compiled with libsrt version 1.5.0 or higher. There are two primary bonding modes:

FFmpeg Command Syntax for SRT Redundancy

To stream using redundant links, you must format your output URI to define an SRT group.

Here is the template for streaming to a remote receiver using Broadcast mode over two local network adapters:

ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -c:a aac -f mpegts \
"srt://?mode=caller&group=192.0.2.1:9000?localaddress=192.168.1.50,192.0.2.1:9000?localaddress=192.168.2.50&type=broadcast"

Breaking Down the Parameters

Receiver Configuration

For redundant streaming to work, the receiving side must also support SRT group connections and listen for incoming bonded links. The receiver command in FFmpeg looks like this:

ffmpeg -i "srt://:9000?mode=listener&group=all" -c copy output.mp4