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:
-i input.mp4: Specifies your input video or audio file.-filter_complex ebur128=peak=true: Activates the EBU R128 filter and enables True Peak level detection.-f null -: Tells FFmpeg to discard the output video/audio stream, as we only need the text analysis printed in the console.
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
- I (Integrated loudness): Your overall file
loudness. In this case, it is
-14.2 LUFS. - LRA (Loudness range): The dynamic variation. A
value of
5.4 LUindicates a relatively consistent volume. - Peak: The True Peak level in decibels relative to
full scale (
dBTP). Here, it is-1.1 dBTP, which is safe from clipping.
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.mp4Command Breakdown:
video=1: Enables the video graphing feature of the filter.size=800x480: Sets the resolution of the output video graph.[v][a]: Names the resulting video and audio streams.-map [v] -c:v libx264: Encodes the generated graph using the H.264 codec.-map [a] -c:a copy: Copies the original audio into the new file without re-encoding it.
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.