[FFmpeg-user] rtmp Stream timeout

Andy Furniss adf.lists at gmail.com
Fri May 6 01:26:29 CEST 2016

Marcel Grandemange wrote:
> Evening
> I sincerely hope someone can assist me with the following case. I
> have the command below which is intended to monitor a rtmp stream and
> look for silence within the stream. It takes the rtmp stream plays it
> for 30 seconds and looks for 1 second of silence within that period,
> this works very well however I have the following case where, if for
> any reason the rtmp stream is invalid or down, ffmpeg will "hang"
> indefinitely trying to play it.

Not the same test, but I've seen with udp/rtp that ffmpeg will wait for
the stream to start. It won't exit with q but will with a signal or
control c. If the stream stops after it's started it takes 2x signals to

Maybe you need to script something to kill the process after some time,
check it's gone and repeat the kill if needed.

> As matter of interest the behavior is not the same with rtsp links.
> If the link is invalid I receive a " Output file #0 does not contain
> any stream" and ffmpeg quits which I'm quite happy with. How do I
> enable similar functionality with rtmp links? A sample of the command
> I use at the moment is below:
> /usr/local/bin/ffmpeg -hide_banner -loglevel 32 -t 30 -i
> rtmp://server/app/stream.stream -af silencedetect=n=-40dB:d=1 -f null
> -

You should normally provide full console output as well as command line.

More information about the ffmpeg-user mailing list