How to force ffmpeg into non-interactive mode?
Asked Answered
H

1

35

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.

Heyerdahl answered 6/2, 2015 at 18:44 Comment(0)
H
50

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

Heyerdahl answered 6/2, 2015 at 18:44 Comment(5)
That's if you want it to always overwrite. If you'd rather it error out then -nostdin is the right option.Heyerdahl
@slhck, -y is not enough. FFmpeg is still eating some characters which is causing weird bugs in the shell scripts.Damar
You appear to need -nostdin -y In order to overwriteYoungyoungblood
running this inside a bash script and calling the script from command line, ffmpeg still outputs to terminalObnubilate
@Obnubilate 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).Vannoy

© 2022 - 2024 — McMap. All rights reserved.