How to Change FFmpeg Log Level to Error and Warning

By default, FFmpeg outputs a highly verbose stream of configuration details, build information, and frame-by-frame metadata during media processing. This article provides a quick guide on how to suppress this cluttered output and configure FFmpeg to only display critical warnings and errors using the command-line flag or environment variables.

Using the -loglevel Flag

The most direct way to limit FFmpeg’s output is by using the -loglevel option (or its alias -v) followed by the desired log level.

To display only errors and warnings, set the log level to warning. In FFmpeg, the log levels are hierarchical, meaning choosing warning will also display higher-severity logs like error, fatal, and panic, while hiding lower-severity logs like info and debug.

Use the following syntax in your command:

ffmpeg -loglevel warning -i input.mp4 output.mp4

Alternatively, you can use the shorter -v alias:

ffmpeg -v warning -i input.mp4 output.mp4

Supported Log Levels

If you need to adjust the verbosity further, FFmpeg supports the following log levels (ordered from least verbose to most verbose):

Hiding the Banner Only

If you still want the standard progress reports but want to hide the large block of build configuration text at the start of the command output, add the -hide_banner flag:

ffmpeg -hide_banner -i input.mp4 output.mp4

You can combine this with your log level for a completely clean terminal experience:

ffmpeg -hide_banner -v warning -i input.mp4 output.mp4

Setting the Log Level Globally

If you want to apply this log level to all FFmpeg commands automatically without typing the flag every time, you can set the FFMPEG_FORCE_LOGLEVEL environment variable.

On Linux/macOS: Add this line to your terminal or your shell profile (e.g., ~/.bashrc or ~/.zshrc):

export FFMPEG_FORCE_LOGLEVEL=warning

On Windows (Command Prompt):

set FFMPEG_FORCE_LOGLEVEL=warning

On Windows (PowerShell):

$env:FFMPEG_FORCE_LOGLEVEL="warning"