I am capturing thumbnails from a webcam RTMP stream every 1 second to JPG files. Here's my command line:
ffmpeg -i rtsp://192.168.1.89:554/11 -f image2 -r 1 thumb%03d.jpg
How can I make FFMPEG die with an error if the input RTMP stream is lost for a given timeout period? Currently, if I lose connection to the webcam, FFMPEG starts throwing "Unknown error" messages, but when the network reconnects, ffmpeg appears to reconnect to the stream, but does not output any more captured frames. I have to manually kill the process and restart it to again start capturing frames.
It would be nice to simply have ffmpeg die when it loses connection for a specific timeout period. Then I could monitor the process and restart when it ends.
Any ideas?