How To Automatically Restart FFmpeg Linux On Error

How To Automatically Restart FFmpeg Linux On Error

Here is example ffmpeg restart script.

Create new script, for example ffmpeg_start.sh and make that script executable:

# chmod +x  ffmpeg_start.sh

Edit file ffmpeg_start.sh and add next commands:

#!/bin/bash
cmd="ffmpeg YOUR_FFMPEG_COMMAND"
until $cmd > /dev/null 2>&1 < /dev/null; do
echo "restarting ffmpeg command..."
sleep 2
done

Do not forget edit YOUR_FFMPEG_COMMAND.

Then run:

# ./ffmpeg_start.sh

 


 

 

If you like what you are reading, please:

Buy me a coffeeBuy me a coffee

Summary
How To Automatically Restart FFmpeg Linux On Error
Article Name
How To Automatically Restart FFmpeg Linux On Error
Description
How To Automatically Restart FFmpeg Linux On Error
Author
Publisher Name
ARSTECH
Publisher Logo

arstech

Leave a Reply

Your email address will not be published. Required fields are marked *