Media Ffmpeg Normalize
Context: $ARGUMENTS
ffmpeg-normalize is a Python wrapper around ffmpeg's loudnorm filter that automates proper 2-pass EBU R128 normalization, batch directories, and preserves non-audio streams. Raw loudnorm is 1-pass by default (dynamic, inaccurate); this tool does the measure-then-apply pass automatically.
Quick start
- Normalize one file (EBU R128 -23 LUFS default):
ffmpeg-normalize in.mp3 -o out.mp3→ Step 3 - Streaming target (-14 LUFS YouTube/Spotify):
ffmpeg-normalize in.wav -t -14 -o out.wav→ Step 2 - Batch a podcast folder:
ffmpeg-normalize episodes/*.mp3 -of out/ -t -16 -tp -1.5 -lrt 11→ Step 3 - Video (keep video stream, re-encode audio only):
ffmpeg-normalize in.mp4 -c:a aac -b:a 192k -o out.mp4→ Step 3
When to use
- Batch-normalizing many files to one target loudness (podcast archive, music library, course videos).
- You want proper 2-pass EBU R128 without wiring the
loudnormJSON round-trip yourself (seeffmpeg-audio-filterskill if you need manual control). - Delivering to broadcast, streaming platforms, or archives with an LUFS spec.
- Don't use for cross-file consistency (e.g., album-gain style). Each file is normalized independently. For consistent relative levels across a set, use a single manual 2-pass
loudnormwith a shared measurement, per theffmpeg-audio-filterskill.
Step 1 — Install
pip install ffmpeg-normalize
# or with uv
uv tool install ffmpeg-normalize
Requires ffmpeg on PATH. Verify:
ffmpeg-normalize --version
ffmpeg -hide_banner -filters | grep loudnorm
Step 2 — Pick a target
Decide the three EBU R128 parameters:
| Flag | Meaning | Typical value |
|------|---------|---------------|
| -t | Integrated loudness (LUFS) | -23 broadcast EBU R128, -24 ATSC A/85, -16 Apple Podcasts, -14 YouTube/Spotify |
| -tp | True peak ceiling (dBFS) | -1.0 to -2.0 (use -1.5 as default) |
| -lrt | Loudness range target (LU) | 11 broadcast / podcast, omit for streaming (no clamp) |
Rule of thumb: broadcast = -23 LUFS, podcast = -16 LUFS, streaming = -14 LUFS. See references/normalize.md for the full platform table.
Step 3 — Batch
Single file:
ffmpeg-normalize input.mp3 -o output.mp3 -t -16 -tp -1.5 -lrt 11
Folder (glob expanded by shell):
ffmpeg-normalize in/*.mp3 -of out/ -t -16 -tp -1.5 -lrt 11 --progress
Video (copy video, re-encode audio — REQUIRED since raw can't be muxed back):
ffmpeg-normalize in.mp4 -c:a aac -b:a 192k -o out.mp4
The helper script:
uv run ${CLAUDE_SKILL_DIR}/scripts/normalize.py preset --input in.mp3 --output out.mp3 --platform apple-podcasts
uv run ${CLAUDE_SKILL_DIR}/scripts/normalize.py batch --indir episodes/ --outdir normalized/ --platform spotify
Dry-run first:
ffmpeg-normalize in.mp3 -o out.mp3 --dry-run
Step 4 — Verify
Measure the output to confirm it hit the target:
ffmpeg -i out.mp3 -af ebur128=peak=true -f null - 2>&1 | tail -20
# Look for: I: (integrated LUFS), LRA, True peak
Or use --print-stats / --debug during the normalize run to emit per-file loudnorm JSON.
Available scripts
scripts/normalize.py—check/normalize/preset/batchsubcommands wrappingffmpeg-normalize; stdlib only.