268

By default ffmpeg sends a whole lot of messages to stderr: when built, how it was built, codecs, etc, etc, etc.

How can I make it quieter?

I've tried -v 0 (and -v 10 since the documentation just coyly says Set the logging verbosity level. with no indication of what the range of inputs is) -- still not quiet.

I've tried -loglevel quiet -- still not quiet.

I should mention, I'm looking for "quieter," not "no output ever". If there's an error I want to see it, but I don't need to hear about ffmpeg's configuration every. single. time.

Matthias Braun
  • 1,162
  • 1
  • 17
  • 29
blahdiblah
  • 4,873
  • 2
  • 22
  • 30
  • 25
    ffmpeg is definitely one of those 'for developers, by developers' kinds of programs. – digitxp Aug 22 '11 at 22:10
  • 8
    Use `-loglevel quiet -stats`. – user287352 May 12 '19 at 07:08
  • 8
    Alternatively `-loglevel error -stats` will show errors "including ones which can be recovered from" and using `-stats` ensures the printing of the encoding progress and statistics line. Changing `-loglevel` from `error` to `warning` is slightly more verbose but comfortably fits on one terminal page. – mattst Oct 09 '19 at 16:15
  • 7
    If you're looking to decrease the verbosity mid-process, you could press `-` and hit enter, and to increase it you could do `shift` and `=` (or `+`) and hit enter to increase it. – TwentyCharMax Jul 07 '20 at 07:19

11 Answers11

286
ffmpeg -hide_banner -loglevel error

This is alluded to in a comment below the current answer.

The option -hide_banner was introduced in late 2013 -- https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2013-December/152349.html )

-loglevel warning leads to more verbose output as it shows all warning messages

-loglevel panic is the least verbose output (omitting even error messages) but is undocumented.

Hugues
  • 3,017
  • 1
  • 14
  • 13
  • 13
    Best answer, however the option -show-banner would be nicer than to hide it – hetepeperfan May 16 '18 at 15:23
  • 11
    Maybe add `-nostats`, too? – Mikko Rantalainen May 18 '18 at 08:28
  • 11
    **Don't use** '-loglevel panic'. The ffmpeg [documentation](https://ffmpeg.org/ffmpeg.html#Generic-options) says "This is not currently used for anything". **Instead,** "-loglevel warning" is recommended: "Any message related to possibly incorrect or unexpected events will be shown." – Small Boy Mar 05 '20 at 09:51
  • 3
    I suggest *-loglevel fatal* instead of -loglevel panic, which should print any error that causes ffmpeg to exit. Panic is even more extreme and may not really be supported in a meaningful way (assertions only) which warning prints various kind of information that may be more than desired in some cases (i.e. what you just want to get it done and don't care if the media is glitchy somehow). – GregD Aug 19 '20 at 15:29
  • 3
    I would like to have an effect opposite to `-loglevel info -nostats`. I would like that it displays encoding progress, but does not display file's internal metadata. – Paul Sep 10 '20 at 21:04
  • Simply adding `-hide_banner` is good enough for me. – Eric Jan 05 '21 at 03:40
  • Also the trouble I was having with the log level options not working and seeing a bunch of info messages like stream keyframes and others was because I was running ffmpeg in one of my typical `while read` shell script loops, so random filenames were being interpreted as ffmpeg user input to control the process. I don't know why I don't need to fix this in other scripts, but `< dev/null` will help guard against that. – Pysis Jul 01 '21 at 18:34
  • @hetepeperfan, the `-show-banner` option already exists - this is the `-version` option. moreover, the `-version` option, like the `-buildconf` option too, works even if you use the `-hide_banner` option. so I created and use `alias ffmpeg='ffmpeg -hide_banner'`, and I can get all the information I need about `ffmpeg` when and only when I need it. – almaceleste Aug 09 '22 at 15:44
133

I haven't tested it out, but I see an option in the man page to do:

ffmpeg -loglevel panic [rest of your ffmpeg stuff]

Should make it so only serious errors are logged, in theory

Alec
  • 1,489
  • 1
  • 10
  • 5
  • 6
    Even with `-loglevel panic`, for me it's only reducing output a little - it still prints version information, stream mapping, configuration options, (and even progress information!).... any ideas? I might have to mention that it's a self-compiled version from latest svn trunk. – codeling Apr 30 '12 at 11:42
  • 8
    pipe it to the bit bucket: >/dev/null 2>&1 – rogerdpack Aug 02 '12 at 15:05
  • 4
    @rogerdpack that would work for most programs, but ffmpeg puts all of its text output to stderr, rather than stdout (it does this so that you can pipe the encoder output to other programs), so redirecting stdout to /dev/null wouldn't do anything useful. – evilsoup Dec 21 '12 at 14:29
  • Ok 2>/dev/null should be enough then (or in windows 2 > NUL) – rogerdpack Dec 21 '12 at 17:02
  • 29
    Using `-hide_banner` in addition to a reduced verbosity level would be a good compromise. – Makaveli84 Aug 12 '14 at 16:14
  • 6
    In addition to everything that has been said, -nostats will disable progress output. – Ely Oct 13 '14 at 12:23
  • 1
    Just a note: on my ancient `ffmpeg` I get "ffmpeg: unrecognized option" for `-nostats` and `-hide_banner`; however `-v 0` disables progress output (while `-loglevel quiet` doesn't); I also tried `-vstats_file /dev/null`, but that doesn't influence the stderr output. – sdaau Jan 28 '15 at 06:14
  • 1
    Although the URLs tend to change over time, it's good to include them also as source of your answer. For example, at present this is documented at https://ffmpeg.org/ffmpeg.html#toc-Generic-options and reader will know where to look in docs even if this URL changes. – Fr0zenFyr Dec 15 '15 at 08:01
  • 1
    As of 3.0.2, -loglevel panic` hides all output, including errors (for example when `-c:a foo` causes `Unknown encoder 'foo'` – qubodup Jul 09 '16 at 17:21
  • hiding things while using ffmpeg is a bad idea especially when converting between formats, codecs, etc. learn how to write the output to a log file but minimize the stdout – μολὼν.λαβέ Jul 26 '17 at 10:29
80

Here you have loglevels from the source code (FFmpeg version 0.10.2.git)

const struct { const char *name; int level; } log_levels[] = {
        { "quiet"  , AV_LOG_QUIET   },
        { "panic"  , AV_LOG_PANIC   },
        { "fatal"  , AV_LOG_FATAL   },
        { "error"  , AV_LOG_ERROR   },
        { "warning", AV_LOG_WARNING },
        { "info"   , AV_LOG_INFO    },
        { "verbose", AV_LOG_VERBOSE },
        { "debug"  , AV_LOG_DEBUG   },
    };
slhck
  • 223,558
  • 70
  • 607
  • 592
surcho
  • 809
  • 6
  • 2
  • 11
    Although the URLs tend to change over time, it's good to include them also as source of your answer. For example, at present this is documented at https://ffmpeg.org/ffmpeg.html#toc-Generic-options and reader will know where to look in docs even if this URL changes. – Fr0zenFyr Dec 15 '15 at 08:01
  • As of 7/21/23, there is an extra option under the `"debug"` line: `{ "trace" , AV_LOG_TRACE },`. – programmar Jul 21 '23 at 07:35
29

I have used with success the following (newest FFMPEG Version at time of writing):

-nostats -loglevel 0

Then it is absolutely quiet in my usage scenario.

suspectus
  • 4,735
  • 14
  • 25
  • 34
Michael
  • 291
  • 3
  • 2
26
ffmpeg -loglevel error [other commands]

This hides the banner and only displays errors. Use -loglevel warning if you would like to see warnings.

Tested in Ffmpeg 3.0.2.

From the documentation:

-loglevel [repeat+]loglevel | -v [repeat+]loglevel

Set the logging level used by the library. Adding "repeat+" indicates that repeated log output should not be compressed to the first line and the "Last message repeated n times" line will be omitted. "repeat" can also be used alone. If "repeat" is used alone, and with no prior loglevel set, the default loglevel will be used. If multiple loglevel parameters are given, using ’repeat’ will not change the loglevel. loglevel is a string or a number containing one of the following values:

‘quiet, -8’

Show nothing at all; be silent.

‘panic, 0’

Only show fatal errors which could lead the process to crash, such as and assert failure. This is not currently used for anything.

‘fatal, 8’

Only show fatal errors. These are errors after which the process absolutely cannot continue after.

‘error, 16’

Show all errors, including ones which can be recovered from.

‘warning, 24’

Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.

‘info, 32’

Show informative messages during processing. This is in addition to warnings and errors. This is the default value.

‘verbose, 40’

Same as info, except more verbose.

‘debug, 48’

Show everything, including debugging information.

‘trace, 56’

By default the program logs to stderr, if coloring is supported by the terminal, colors are used to mark errors and warnings. Log coloring can be disabled setting the environment variable AV_LOG_FORCE_NOCOLOR or NO_COLOR, or can be forced setting the environment variable AV_LOG_FORCE_COLOR. The use of the environment variable NO_COLOR is deprecated and will be dropped in a following FFmpeg version.

qubodup
  • 8,365
  • 7
  • 36
  • 49
  • 1
    `-loglevel error -v error -stats` did the trick. Only errors or worse are shown and you can still see progress. – Jan May 04 '23 at 10:17
20

The following worked for me on macOS:

ffmpeg -v quiet

or to only see the progress:

ffmpeg -v quiet -stats
morja
  • 301
  • 2
  • 5
  • 4
    That's exactly what I was looking for. I'm using ffmpeg in a script and need to see that it's working, but don't need all the info about input and output streams etc. – stib Feb 26 '19 at 05:01
  • 1
    Wow, thank you. Finally a command that hides the many leading lines of cruft (unless you don't know what you're dealing with, which you usually do...) but still shows the progress! Until now it looked like an either/or case... – Jonas May 20 '20 at 19:54
  • If you want to see _warnings_ and _errors_, if any, otherwise want it to be quiet, use `ffmpeg -v 24 -stats`. 24 stands for loglevel _warning_. – Venkata Raju Jun 30 '21 at 05:13
  • I wanted a solution which will show the progress, but hide everything else. This is the only solution that worked. And, this also work on Linux systems. – Puspam Jul 28 '22 at 12:14
10

ffmpeg -loglevel error -hide_banner -nostats

Just the errors, nothing else.

I personally like this best;

ffmpeg -loglevel warning -hide_banner -stats

It gives only warnings and errors, but also shows the progress of work.

3

You can pipe stderr through grep. For example, if you wanted to remove the configuration info, you could do it like this:

% ffmpeg -i infile.avi -s 640x480 outfile.avi >/dev/null 2>&1 | grep -v configuration:
slm
  • 9,959
  • 10
  • 49
  • 57
LittleRed
  • 31
  • 1
0

These measures don't hide the Codec banner (even with "-loglevel 0"). For hiding the H.265-banner it would look like this:

-vcodec libx265 -x265-params log-level=error
conracer
  • 1
  • 1
0

All the answers are a bit old at my time of writing, so for new version in 2021, -loglevel warning dumps a lot of hex codes, and you cannot see the warnings. -loglevel error also dumps lots of hex, you cannot see the 'errors'. -loglevel fatal runs fine but slowly. Perhaps it expects some output. -loglevel panic runs fast, but you miss out on fatal errors. The best you could use, is:
Windows (cmd/dos) & Python3:

from os import system
for file in list:
    system('ffmpeg -hide_banner -loglevel fatal -nostats (your options)>file.txt')

Unix & Python3:

from os import system
for file in list:
    system('ffmpeg -hide_banner -loglevel fatal -nostats (your options)&>file.txt')

Now, search which files are not blank.

from os import stat
for file in list:
    if stat('file').st_size == 0:
        continue
    else:
        print(file)

Check those files which have some output.

Fat Frog
  • 1
  • 6
0

This is a little cheap to go about it, but appending >/dev/null 2>&1 is a sure way to keep ffmpeg silent in the shell.

Example

ffmpeg -f x11grab -y -r 24 -s 800x600 -i :0.0+1366,100 -f oss -i /dev/dsp3 -sameq ./out.avi >/dev/null 2>&1

More info about bash output

Koodough
  • 62
  • 3
  • 16
    Except that ffmpeg is one step ahead of you, and outputs both configuration information and *actual* errors to stderr. – blahdiblah Aug 23 '11 at 19:19