Configure SRT maxbw in FFmpeg

This article explains how to configure the maximum bandwidth (maxbw) parameter for Secure Reliable Transport (SRT) streaming using FFmpeg. You will learn the correct syntax, how the parameter limits stream overhead, and practical command-line examples to optimize your live video transmission.

Understanding the maxbw Parameter

In SRT streaming, the maxbw (maximum bandwidth) parameter controls the maximum transfer rate for the stream, including both the payload (video/audio data) and the SRT protocol overhead (retransmitted packets, control packets, and headers).

By default, FFmpeg sets maxbw to -1. In this state, SRT automatically calculates the maximum bandwidth using the overheadbwlimit parameter (which defaults to 25% overhead above the input bitrate). However, when streaming over connections with strict bandwidth caps, manually configuring maxbw prevents the stream from exceeding your network’s capacity.

Syntax and Unit of Measurement

In FFmpeg, SRT parameters are appended directly to the output SRT URL as query parameters.

Important: The maxbw value must be specified in bytes per second, not bits per second.

To convert your target bandwidth from Megabits per second (Mbps) to bytes per second, use this formula: Value in Bytes/sec = (Mbps * 1,000,000) / 8

For example: * 1 Mbps = 125,000 bytes/sec * 5 Mbps = 625,000 bytes/sec * 10 Mbps = 1,250,000 bytes/sec

FFmpeg Command Examples

1. Basic SRT Output with maxbw Limit

The following command transcodes an input file and streams it to an SRT receiver, capping the maximum bandwidth at 5 Mbps (625,000 bytes per second):

ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -b:v 3000k -codec:a aac -f mpegts "srt://12.34.56.78:9000?maxbw=625000"

2. Combining maxbw with Other SRT Parameters

To configure multiple parameters, such as latency (in microseconds) and mode, separate them with an ampersand (&). In this example, the latency is set to 120ms (120,000 microseconds) and the maximum bandwidth is capped at 10 Mbps (1,250,000 bytes per second):

ffmpeg -re -i input.mp4 -c:v libx264 -preset ultrafast -b:v 6000k -f mpegts "srt://12.34.56.78:9000?mode=caller&latency=120000&maxbw=1250000"

Best Practices