I'm trying to convert video with ffmpeg on a remote computer using SSH. Sometimes I get disconnected or get a server timeout and the process is interrupted. I've tried a bash script with the following command:

ffmpeg -i input.mkv -threads 4 -c:v libx264 -crf 30 -preset slow output.mp4 

but it's also interrupted when loose my connection in Putty.


1 Answer 1


Try screen. It's sort of a virtual terminal that runs your shell. You start by typing "screen [enter]" then it starts your favorite shell (bash?).

Start your script and press "[CTRL]-A-D" then screen goes to background while still running your shell and tasks and you can log off. Also works like this when connection drops.

Not the answer you're looking for? Browse other questions tagged or ask your own question.