I'm trying to configure restream server, ffmpeg listen on rtmp://ip:port and output to few stream services(youtube, twitch…etc) the problem is when I stop OBS streaming(using this on local pc) ffmpeg on server going down and i need manually run it next time I go stream. Can't find option in ffmpeg dock which will make ffmpeg continue listening even if input source go down. Maybe I'm missing something in docs or it's time to make scripts which will restart ffmpeg?
I'm using this command for ffmpeg:
ffmpeg -re -listen 1 -i rtmp://i.p:1234 -c:v libx264 -preset medium -maxrate 3500k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmp://live-ams.twitch.tv/app/key
Best Answer
When you work with Linux, you could make a systemd services:
When the input fails, it starts the process again.