34

Sometimes you want ffmpeg to ask you whether it should overwrite a file. Sometimes it's just a script that you prefer would fail if something is amiss. I.e. don't rely on stdin to answer if you have a question.

ubershmekel
  • 11,864
  • 10
  • 72
  • 89

1 Answers1

48

See https://ffmpeg.org/ffmpeg.html#Main-options

-stdin - Enable interaction on standard input. On by default unless a pipe is detected.

-nostdin - To explicitly disable console interactions. Without -y this will cause ffmpeg to error out if the target file exists.

-y - To overwrite the output file

ubershmekel
  • 11,864
  • 10
  • 72
  • 89
  • 4
    That's if you want it to always overwrite. If you'd rather it error out then `-nostdin` is the right option. – ubershmekel Feb 10 '15 at 01:23
  • @slhck, `-y` is not enough. FFmpeg is still eating some characters which is causing weird bugs in the shell scripts. – Velkan Apr 05 '18 at 09:26
  • You appear to need -nostdin -y In order to overwrite – GlynD Apr 12 '19 at 10:47
  • running this inside a bash script and calling the script from command line, ffmpeg still outputs to terminal – Freedo May 15 '19 at 08:11
  • @Freedo if you want to redirect the output you can always use the shell redirect `ffmpeg ... > output.log 2>&1` (the `2>&1` is if you want errors to also go to that log file). – Alexis Wilke Aug 03 '21 at 18:53