How to Stream SRT Live Video using FFmpeg Listener

This article provides a quick guide on how to configure and run an FFmpeg command to stream live video over the Secure Reliable Transport (SRT) protocol using listener mode. You will learn the exact command-line syntax, understand the key parameters required for listener mode, and see how a remote client can connect to ingest your stream.

Understanding SRT Listener Mode

In an SRT connection, one side must act as the listener (waiting for a connection) and the other as the caller (initiating the connection). When you configure FFmpeg as an SRT listener, it opens a local port and waits for a playback device, CDN, or receiver to connect and pull the live stream.

The FFmpeg Command

To stream a video file or live input as an SRT listener, use the following command structure:

ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -b:v 3000k -c:a aac -f mpegts "srt://0.0.0.0:9000?mode=listener"

Parameter Breakdown

How to Connect and Receive the Stream

Because FFmpeg is running as the listener, the receiver must connect as a caller.

To play the stream using another instance of FFmpeg (or a compatible player like VLC), point the receiving application to the IP address of the streaming machine using the caller mode:

ffplay "srt://<STREAMER_IP_ADDRESS>:9000?mode=caller"

Replace <STREAMER_IP_ADDRESS> with the actual IP address of the machine running the FFmpeg listener command. Make sure that your system’s firewall allows incoming UDP traffic on your chosen port (port 9000 in this example).