Skip to content

slhck/ffmpeg-normalize

Repository files navigation

ffmpeg-normalize

PyPI version Docker Image Version GitHub Actions Workflow Status

All Contributors

A utility for batch-normalizing audio using ffmpeg.

This program normalizes media files to a certain loudness level using the EBU R128 loudness normalization procedure. It can also perform RMS-based normalization (where the mean is lifted or attenuated), or peak normalization to a certain target level.

✨ Features

  • EBU R128 loudness normalization β€” Two-pass by default, with an option for one-pass dynamic normalization
  • RMS-based normalization β€” Adjust audio to a specific RMS level
  • Peak normalization β€” Adjust audio to a specific peak level
  • Selective audio stream normalization β€” Normalize specific audio streams or only default streams
  • Video file support β€” Process video files while preserving video streams
  • Docker support β€” Run via Docker container
  • Python API β€” Use programmatically in your Python projects
  • Shell completions β€” Available for bash, zsh, and fish
  • Album Batch normalization – Process files jointly, preserving relative loudness

πŸš€ Quick Start

  1. Install a recent version of ffmpeg
  2. Run pip3 install ffmpeg-normalize and ffmpeg-normalize /path/to/your/file.mp4, alternatively install uv and run uvx ffmpeg-normalize /path/to/your/file.mp4
  3. Done! 🎧 (the normalized file will be called normalized/file.mkv)

πŸ†• What's New

  • Version 1.36.0 introduces presets with --preset! Save and reuse your favorite normalization configurations for different use cases. Comes with three built-in presets: podcast (AES standard), music (RMS-based batch normalization), and streaming-video (video content). Create custom presets too!

    Example:

    ffmpeg-normalize input.mp3 --preset podcast

    applies the podcast preset (EBU R128, -16 LUFS) to your file. Learn more in the presets guide.

  • Version 1.35.0 has batch/album normalization with --batch. It preserves relative loudness between files! Perfect for music albums where you want to shift all tracks by the same amount.

    Example:

    ffmpeg-normalize album/*.flac --batch -nt rms -t -20

    shifts the entire album so the average RMS is -20 dB, preserving the original relative loudness as mastered.

  • Version 1.34.0 brings selective audio stream normalization! You can now:

    • Normalize specific audio streams with -as/--audio-streams (e.g., -as 1,2 to normalize only streams 1 and 2)

    • Normalize only default audio streams with --audio-default-only (useful for files with multiple language tracks)

    • Keep other streams unchanged with --keep-other-audio (copy non-selected streams without normalization)

      Example:

      ffmpeg-normalize input.mkv -as 1 --keep-other-audio

      normalizes stream 1 and copies all other audio streams unchanged.

Other recent additions:

  • Shell completions (v1.31.0) β€” Tab completion for bash, zsh, and fish shells. See the installation guide for setup instructions.
  • --lower-only option β€” Prevent audio from increasing in loudness, only lower it if needed (works with all normalization types).

See the full changelog for all updates.

πŸ““ Documentation

Check out our documentation for more info!

🀝 Contributors

The only reason this project exists in its current form is because @benjaoming's initial PRs. Thanks for everyone's support!

Benjamin Balder Bach
Benjamin Balder Bach

πŸ’»
Eleni Lixourioti
Eleni Lixourioti

πŸ’»
thenewguy
thenewguy

πŸ’»
Anthony Violo
Anthony Violo

πŸ’»
Eric Jacobs
Eric Jacobs

πŸ’»
kostalski
kostalski

πŸ’»
Justin Pearson
Justin Pearson

πŸ’»
ad90xa0-aa
ad90xa0-aa

πŸ’»
Mathijs
Mathijs

πŸ’»
Marc PΓΌls
Marc PΓΌls

πŸ’»
Michael V. Battista
Michael V. Battista

πŸ’»
WyattBlue
WyattBlue

πŸ’»
Jan-Frederik Schmidt
Jan-Frederik Schmidt

πŸ’»
mjhalwa
mjhalwa

πŸ’»
07416
07416

πŸ“–
sian1468
sian1468

⚠️
Panayiotis Savva
Panayiotis Savva

πŸ’»
HighMans
HighMans

πŸ’»
kanjieater
kanjieater

πŸ€”
Ahmet Sait
Ahmet Sait

πŸ’»
georgev93
georgev93

πŸ’»
David Bern
David Bern

πŸ’»
Image Add your contributions