DEV Community

Javid Jamae
Javid Jamae

Posted on • Originally published at ffmpeg-micro.com

FFmpeg loudnorm Filter: EBU R128 Loudness Normalization Guide

Originally published at ffmpeg-micro.com

Your viewers shouldn't need to reach for the volume knob between videos. The EBU R128 standard exists to fix that, and FFmpeg's loudnorm filter is how you implement it. But the filter has quirks that trip people up: two-pass workflows that require parsing JSON from stderr, a linear mode that silently changes behavior, and parameter defaults aimed at broadcast TV instead of streaming.

This guide covers what each parameter does, when to use single-pass vs two-pass, and how to avoid the mistakes that lead to audio that's technically compliant but sounds wrong.

Quick answer: normalize to -16 LUFS for streaming

ffmpeg -i input.mp4 -af "loudnorm=I=-16:TP=-1.5:LRA=11" -c:v copy output.mp4
Enter fullscreen mode Exit fullscreen mode

This targets -16 LUFS (the YouTube and Spotify standard), caps true peak at -1.5 dBTP, and allows 11 LU of dynamic range. The -c:v copy flag passes video through untouched so only audio gets re-encoded.

What I, TP, and LRA actually mean

EBU R128 defines loudness through three measurements:

Parameter What it measures Default Streaming target
I (Integrated) Average loudness over the full file -24 LUFS -14 to -16 LUFS
TP (True Peak) Maximum instantaneous sample value -2 dBTP -1 to -2 dBTP
LRA (Loudness Range) Spread between quiet and loud sections 7 LU 7-20 LU

I (Integrated Loudness) is the number most people care about. YouTube normalizes to -14 LUFS, Spotify uses -14 LUFS, Apple Music uses -16 LUFS.

TP (True Peak) catches inter-sample peaks that a regular peak meter misses.

LRA (Loudness Range) is the spread between quiet and loud sections.

Two-pass loudnorm (measured mode)

Two-pass gives you precise results because the filter analyzes the entire file before making changes.

Pass 1: Measure the input

ffmpeg -i input.mp4 -af "loudnorm=I=-16:TP=-1.5:LRA=11:print_format=json" -f null - 2>&1 | tail -12
Enter fullscreen mode Exit fullscreen mode

Pass 2: Apply with measured values

ffmpeg -i input.mp4 -af "loudnorm=I=-16:TP=-1.5:LRA=11:measured_I=-22.35:measured_TP=-3.21:measured_LRA=8.70:measured_thresh=-33.50:offset=0.02:linear=true" -c:v copy output.mp4
Enter fullscreen mode Exit fullscreen mode

Linear vs dynamic mode

Linear mode applies a single constant gain to the entire file. Use for music and cinematic audio.

Dynamic mode (default) actively compresses audio. Better for speech content.

Common pitfalls

  • Wrong target for the platform. Default -24 LUFS is for broadcast TV. Streaming uses -14 to -16 LUFS.
  • Forgetting -c:v copy. Re-encodes video unnecessarily.
  • Two-pass without linear=true. Defeats the purpose of measuring first.

Read the full guide on ffmpeg-micro.com for the complete FAQ and API examples.

Top comments (0)