I'm responsible for maintaining a device that streams a live webcam feed to a remote relay server, and simultaneously writes a version of the stream to the local disk. It does this by a single instance of ffmpeg that has two outputs - one to the local disk, and one over rtsp to the streaming server
I'm encountering a problem where by if the streaming server disconencts for any reason, ffmpeg quits. I'm not really bothered if the live stream is lost, but it's a big problem that the local recording is lost also - it's not a huge detriment to the particular business process if it cannot be watched live, but losing the locally stored copy is a disaster
ffmpeg is started with a command line similar to:
ffmpeg -thread_queue_size 4096 -async 1 -f v4l2
-input_format mjpeg -framerate 30 -video_size 1280x720
-i /dev/video0 -thread_queue_size 4096 -async 1 -f alsa
-i plughw:CARD=Set,DEV=0 -r 30 -c:a aac -b:a 96k -c:v h264 -b:v 983040
-profile:v baseline -preset veryfast -pix_fmt yuv420p
-f tee -map 0:v -map 1:a
[f=matroska]'/var/recordings/yyyy-mm-dd/backup.mkv'|
[f=rtsp:rtsp_transport=tcp]rtsp://streamingserver.com:1234/session.sdp`
Is there any way (command line switch etc) that ffmpeg can be made to carry on if an output stream is lost, rather than quitting?