FFmpeg ebur128 Loudness Analysis Tutorial

This article explains how to use the FFmpeg ebur128 filter to analyze the loudness of your audio files according to professional broadcasting standards. You will learn the core concepts of the EBU R128 standard, how to run basic and advanced command-line scans, interpret the console output, and generate visual loudness graphs to ensure your audio meets platform requirements like YouTube, Spotify, or television broadcast specifications.

What is EBU R128?

The EBU R128 standard regulates audio loudness to prevent sudden volume jumps between different programs or tracks. Instead of measuring peak audio levels, it measures perceived loudness using three main metrics: * Integrated Loudness (I): The average loudness of the entire file, measured in LUFS (Loudness Units Full Scale). Most streaming platforms target -14 LUFS, while TV broadcasts often target -23 or -24 LUFS. * Loudness Range (LRA): The statistical distribution of loudness over time, showing the dynamic range of the audio. * True Peak (TP): The absolute peak level of the signal, measuring inter-sample peaks to avoid digital clipping.

Basic Loudness Analysis Command

To analyze an audio or video file without rendering a new media file, use the following FFmpeg command. This processes the audio and outputs the statistical data directly to your terminal:

ffmpeg -i input.mp4 -filter_complex ebur128=peak=true -f null -

Command Breakdown:

Interpreting the Output

When the command finishes running, look at the final block of text in your terminal. It will look similar to this:

[Parsed_ebur128_0 @ 0x7fa89bc0c100] Summary:

  Integrated loudness:
    I:         -14.2 LUFS
    Threshold: -24.2 LUFS

  Loudness range:
    LRA:         5.4 LU
    Threshold: -34.4 LUFS
    LRA low:   -17.5 LUFS
    LRA high:  -12.1 LUFS

  True peak:
    Peak:       -1.1 dBTP

Generating a Visual Loudness Graph

The ebur128 filter can also generate a real-time video graph showing how the loudness changes over the duration of the file. This is highly useful for spotting sudden volume spikes.

Run the following command to output a video file containing the visual meter:

ffmpeg -i input.wav -filter_complex ebur128=video=1:size=800x480[v][a] -map [v] -c:v libx264 -map [a] -c:a copy output.mp4

Command Breakdown:

The resulting output.mp4 will display a scrolling multi-colored graph detailing momentary loudness (green), short-term loudness (blue), and integrated loudness (red line), allowing you to visually pinpoint where your audio violates target thresholds.