How to force ffmpeg into non-interactive mode?

14,049

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

Share:
14,049
ubershmekel
Author by

ubershmekel

https://www.yuvalg.com

Updated on June 14, 2022

Comments

  • ubershmekel
    ubershmekel about 2 years

    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
    ubershmekel over 9 years
    That's if you want it to always overwrite. If you'd rather it error out then -nostdin is the right option.
  • Velkan
    Velkan about 6 years
    @slhck, -y is not enough. FFmpeg is still eating some characters which is causing weird bugs in the shell scripts.
  • GlynD
    GlynD about 5 years
    You appear to need -nostdin -y In order to overwrite
  • Freedo
    Freedo about 5 years
    running this inside a bash script and calling the script from command line, ffmpeg still outputs to terminal
  • Alexis Wilke
    Alexis Wilke almost 3 years
    @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).