I'm using FFMPEG to convert my rtsp stream into an HLS stream so it can be played on all browsers on my website using player js. I'm having an issue with FFMPEG dying if the internet connection to the rtsp stream goes out for a min. Is there a way to make it reconnect? I've tried using the -reconnect flag before the -i flag, but I got back that the command wasn't found.
ffmpeg -i rtsp://rtspstreamaddress/1 -fflags flush_packets -max_delay 2 -flags -global_header -hls_time 2 -hls_list_size 3 -vcodec copy -y /var/www/video.m3u8
I then have a website that uses playwerjs to show the live stream. How can I make sure that the stream stays up without having to manually log into the VPS and rerun the script.