[FFmpeg-user] Split RTSP stream to file and socket

Alex A. Hutnik alex.hutnik at gmail.com
Sun Oct 16 18:13:03 EEST 2016


As the subject suggests, I have an RTSP stream (from an IP camera).  I'm trying
to create two outputs: a file recording the stream, and a unix socket.
Specifically, the file output is just an MP4 file.  For the socket
output I want to pass the stream through the 'fps' filter first.  I
tried this:

ffmpeg -i rtsp://ip/stream -filter_complex
'[0:v]split=2[in1][in2];[in2]fps=4[out2]' -map '[in1]' out.mp4 -map
'[out2]' unix://video_stream

I intend to use some python scripts to do something with the 4FPS
video coming in from that socket.

I thought about (and tried) using a named pipe but couldn't get that
working. Plus to my knowledge pipes are blocking and I would like
ffmpeg to continue writing to the MP4 file regardless of the python
script processing input from the socket or pipe.

Is this possible?

More information about the ffmpeg-user mailing list