(FFmpeg) How to normalize audio?

Ever get an audio file that just isn’t loud enough but when the volume is edited it peaks? The solution for this problem is to run the audio through a normalization algorithm. Normalization with loudnorm, uses a true peak loudness to increase the maximum volume for each bit.

For audio signals on radio and tv broadcasts, a guideline exists for the permitted maximum levels thus setting a standard for increasing the volume throughout a track. This filter increases volume without changing the sound, compression or quality. This normalization standard is called EBU R128 and what the loudnorm filter is built off of.

If this is starting to feel complex, don’t worry, here’s the recommended settings for normalizing audio with loudnorm: 

  $ ffmpeg -i input.mp3 -af loudnorm=I=-16:LRA=11:TP=-1.5 output.mp3  

Tip: The above example has been found all over the internet, without a clear identity of who invented these exact variables. Play around with the values to get a sound you prefer.

	Indicates the name of the normalization filter

I, i
	Indicates the integrated loudness (-70 to -5.0 with default -24.0)

LRA, lra
	Indicates the loudness range (1.0 to 20.0 with default 7.0)

TP, tp
	Indicates the max true peak (-9.0 to 0.0 with default -2.0)

For more information on loudnorm, visit: https://ffmpeg.org/ffmpeg-filters.html#loudnorm