Prevent errors during ffmpeg execution in a loop

instead of processing the video file, ffmpeg would stop and wait for user input. The message ‘error parsing debug value’ would also be displayed prior to input being asked.

Turns out this happens because by default ffmpeg is in interactive mode. This means that the output it was producing was being used as input and eventually certain input characters caused ffmpeg to stop and ask for user input.

There are two ways to stop this from happening:

  1. Add ‘< /dev/null’ to the end of the ffmpeg command so it reads input from the null device instead of standard input
  2. Add ‘-nostdin’ to the ffmpeg command as per documentation to stop it reading input from standard input by default

I went for the first option, so my command to transcode all AVI files in a directory to H.264 with AAC MKV files looked like this:

发表评论

您的电子邮箱地址不会被公开。