Skip to main content

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
  • Skip files already at target — Avoid re-encoding files already within a threshold of the target level
  • Self-documenting output — Optionally record the effective encoder settings as an ENCODER_SETTINGS tag
  • 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 and Python 3.10 or higher
  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.42.0 can optionally write an ENCODER_SETTINGS tag on each normalized audio stream via --write-encoder-settings. The tag holds an ffmpeg-command-equivalent string — the audio codec, bitrate, sample rate and channels, plus the normalization filter including the measured loudnorm values — so a normalized file documents how it was produced. This is a Matroska/WebM convention and has no effect with --metadata-disable.

    Example:

    ffmpeg-normalize input.wav -c:a libopus -b:a 128k --write-encoder-settings -o output.mkv
    
  • Version 1.41.0 automatically picks the correct output audio codec for the output container, so you no longer need to specify -c:a/--audio-codec unless you want to override the default. PCM is chosen for containers that support it; others will use teh default that ffmpeg picks. See the usage guide for details.

  • Version 1.40.0 can optionally skip files that are already at the target level via --threshold (e.g. --threshold 0.5, disabled by default). Such files are copied through unchanged instead of being re-encoded. The --print-stats output now includes a per-file status (normalized, skipped, or error, plus an error message on failure), and the exit code is non-zero if any file failed to process, so a script can tell what happened to each file.

    Example:

    ffmpeg-normalize input.flac -nt peak -t 0 -c:a flac --print-stats -o output.flac
    
  • Version 1.39.0 preserves the input bit depth by default when encoding to formats like FLAC, so 16-bit input stays 16-bit without needing -e "-sample_fmt s16". Use --no-keep-bit-depth to opt out. It also adds --keep-mtime to copy the input file's modification time to the output, which is useful for preserving when a track was added to a music library.

    Example:

    ffmpeg-normalize input.flac -nt peak -t 0 -c:a flac --keep-mtime -o output.flac
    
  • Version 1.38.0 writes the normalized output directly to the destination without using temporary files

  • 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

💻
randompersona1
randompersona1

💻
Petr
Petr

💻
Add your contributions

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffmpeg_normalize-1.42.0.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ffmpeg_normalize-1.42.0-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

Details for the file ffmpeg_normalize-1.42.0.tar.gz.

File metadata

  • Download URL: ffmpeg_normalize-1.42.0.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for ffmpeg_normalize-1.42.0.tar.gz
Algorithm Hash digest
SHA256 702aaaa6e9c5ef39f8407a12dd04c0b727935fff80288c4554c97a14e5988d6c
MD5 a9789cf3671754dcfd1ed880a5a5fbc9
BLAKE2b-256 5b74d0a3a9bdd2748c41dedafb90f522ad3fbb614ed41fee574eb2d9950e40f5

See more details on using hashes here.

File details

Details for the file ffmpeg_normalize-1.42.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ffmpeg_normalize-1.42.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49829d27e03003307a1af82b7baf328aa52f0b7f9f71e884beafd49fb619dab8
MD5 0a8c7af11ee9b658a0ba72c8f08ac254
BLAKE2b-256 80628a1b7eab64ccaa07a85f637b31fee6f071751dc6001cdee4342e3014f4ff

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.42.0 This release

2 files

1.41.1

2 files

1.41.0

2 files

1.40.0

2 files

1.39.0

2 files

1.38.0

2 files

1.37.8

2 files

1.37.7

2 files

1.37.6

2 files

1.37.5

2 files

1.37.4

2 files

1.37.3

2 files

1.37.2

2 files

1.37.1

2 files

1.37.0

2 files

1.36.1

2 files

1.36.0

2 files

1.35.0

2 files

1.34.0

2 files

1.33.4

2 files

1.33.3

2 files

1.33.2

2 files

1.33.1

2 files

1.33.0

1 file

1.32.5

1 file

1.32.4

1 file

1.32.3

1 file

1.32.2

2 files

1.32.1

2 files

1.32.0

2 files

1.31.3

2 files

1.31.2

2 files

1.31.1

2 files

1.31.0

2 files

1.30.0

2 files

1.29.2

2 files

1.29.1

2 files

1.29.0

2 files

1.28.3

2 files

1.28.2

2 files

1.28.1

2 files

1.28.0

2 files

1.27.7

2 files

1.27.6

2 files

1.27.5

2 files

1.27.4

2 files

1.27.3

2 files

1.27.2

2 files

1.27.1

2 files

1.27.0

2 files

1.26.6

2 files

1.26.5

2 files

1.26.4

2 files

1.26.3

2 files

1.26.2

2 files

1.26.1

2 files

1.26.0

2 files

1.25.3

2 files

1.25.2

2 files

1.25.1

2 files

1.25.0

2 files

1.24.1

2 files

1.24.0

2 files

1.23.1

2 files

1.23.0

2 files

1.22.10

2 files

1.22.9

2 files

1.22.8

2 files

1.22.7

2 files

1.22.6

2 files

1.22.5

2 files

1.22.4

2 files

1.22.3

2 files

1.22.2

2 files

1.22.1

2 files

1.22.0

2 files

1.21.2

2 files

1.21.1

2 files

1.21.0

2 files

1.20.2

2 files

1.20.1

2 files

1.20.0

2 files

1.19.1

2 files

1.19.0

2 files

1.18.2

2 files

1.18.1

2 files

1.18.0

2 files

1.17.0

2 files

1.16.0

2 files

1.15.8

2 files

1.15.7

2 files

1.15.6

2 files

1.15.5

2 files

1.15.4

2 files

1.15.3

2 files

1.15.2

2 files

1.15.1

2 files

1.15.0

2 files

1.14.1

1 file

1.14.0

1 file

1.13.11

1 file

1.3.10

1 file

1.3.8

1 file

1.3.7

1 file

1.3.5

1 file

1.3.4

1 file

1.3.3

1 file

1.3.2

1 file

1.3.1

1 file

1.2.3

1 file

1.2.2

1 file

1.2.1

1 file

1.2.0

1 file

1.1.0

1 file

1.0.10

1 file

1.0.9

1 file

1.0.8

1 file

1.0.7

1 file

1.0.6

1 file

1.0.5

1 file

1.0.4

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

1.0

1 file

0.7.3

1 file

0.7.2

1 file

0.7.1

1 file

0.7.0

1 file

0.6.0

1 file

0.5.2

1 file

0.5.1

1 file

0.5

1 file

0.4.3

1 file

0.4.2

1 file

0.4.1

1 file

0.4.0

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page