Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimal SRT Stream Example with ffmpeg

Tags:

ffmpeg

I'm having a hard finding a simple solution to showcase the srt streaming protocol with FFmpeg. The only article that I've found, is either going over multiple hoops to setup a stream. Is there no way to do a simple receiver/sender principle like in the old days with udp?

Sender:

ffmpeg  -i myfile.mp4 -vcodec libx264 -crf 12 -f mpegts udp://192.168.1.5:1234

Receiver:

ffplay udp://192.168.1.5:1234
like image 562
user1767754 Avatar asked Sep 01 '26 23:09

user1767754


1 Answers

I also miss comprehensive documentation and explanation on how to use SRT. However here is a minimum example I use:

Sender which acts as a listener and waits for connections:

ffmpeg -i test.mp4 -c:v libx264 -f mpegts 'srt://:40052?mode=listener&latency=20000000'

Receiver which acts as a caller:

ffmpeg -i 'srt://192.168.1.345:40052?mode=caller' -c copy output.mkv
like image 175
jokober Avatar answered Sep 05 '26 16:09

jokober