With ffmpeg you send a file, a test pattern or any other source ffmpeg can read to an input of your studio over SRT. You need an ffmpeg built with libsrt and the input's address. In the command line below, the one we test with ourselves, you only put in host, port and stream ID.
Preparation
- Check your ffmpeg:
ffmpeg -protocolshas to listsrt(srtpis something else). If it is missing, you need an ffmpeg with libsrt, see ffmpeg.org. - In your studio, click “Connect source” at the input on the “Inputs” tab. The address has the form
srt://<host>:<port>?streamid=<id>.
The command line
ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -tune zerolatency -pix_fmt yuv420p -b:v 6M -maxrate 6M -bufsize 6M -g 120 -bf 0 -c:a aac -b:a 128k -ar 48000 -ac 2 -f mpegts "srt://<host>:<port>?mode=caller&transtype=live&latency=800000&pkt_size=1316&streamid=<id>"
<host>,<port>,<id>: from your input's address. Everything else after the question mark stays.- Keep the quotation marks around the address, or the shell interprets the
&itself. latencyis in microseconds: 800000 is 800 ms. On a good line less works, down to- There is no passphrase. Do not append a
passphraseparameter. - Keep
-re: without it ffmpeg sends the file faster than real time.
A test pattern instead of a file: replace -re -i input.mp4 with
-re -f lavfi -i testsrc2=size=1920x1080:rate=60 -re -f lavfi -i sine=frequency=1000:sample_rate=48000. The
pattern shows up on the desk as the input's scene, the tone on the input's level meter. Stop it with Ctrl+C.
Encoder values: The right encoder settings. More latency on an unsteady link: Setting the SRT latency.
When nothing arrives
- ffmpeg does not know the protocol: your ffmpeg lacks libsrt.
- The connection breaks off at once: compare host, port and stream ID with the “Inputs” tab.
- ffmpeg runs, but no picture appears in the studio: many hotel and company networks block UDP, and SRT needs UDP. Go on with No picture in the studio.