How to normalize audio? - John Riselvato
Created on 2021-12-11T22:00:09-06:00
Can run in real time or in a two-pass format.
One-pass attempts to adjust the volume to meet some LUFS loudness target:
$ ffmpeg -i input.mp3 -af loudnorm=I=-16:LRA=11:TP=-1.5 output.mp3
The above runs in 'dynamic' mode.
Can also run twice and specify measured levels to run in 'static' mode which scales the entire sound track to meet the loudness target (while allowing loudness peaks and valleys internally.)
This isn't like dynaudnorm which continuously adjusts the sound to meet loudness targets.
- --
I use something like this to correct sound files headed out to the MP3 player.
f in *.flac; ~/code/external/ffmpeg/ffmpeg -y -i "$f" -vn -af loudnorm=I=-23:TP=-1.5:LRA=11:tp=-2 -c:a libfdk_aac -b:a 128k -ar 48k /tmp/(string replace ".flac" ".m4a" $f); end