[FFmpeg-user] filter_complex for multiple rtmp stream

kamal shadi kamal.shadi85 at gmail.com
Sun Oct 22 03:44:05 EEST 2017

Hi all,

I am trying to apply a filter_complex operation on multiple rtmp streams.
Here is my sample run of ffmpeg to do so:

*ffmpeg -i rtmp://localhost/live1/stream1 -i rtmp://localhost/live1/stream2
-filter_complex "[1][2]overlay=x=160:y=0" -c:v libx264 -preset veryfast
-b:v 2000k -bufsize 4000k -c:a copy -r 30 out.mov;*

I want the stream1 to render into output no matter if the stream2 is
available or not. but the above command waits for both streams to be
available. When stream2 is not connected I get following error:

*RTMP_ReadPacket, failed to read RTMP packet
headerrtmp://localhost/live1/stream2: Invalid data found when processing

How can I use a placeholder for stream2? Something like A nullsrc filter
that kicks in whenever stream2 is not available?

Thanks in advance,

P.S: In case it matters, the above commands are run on nginx rtmp module
for the server.

More information about the ffmpeg-user mailing list