Configure FFmpeg dynaudnorm Filter Parameters

The FFmpeg dynaudnorm (Dynamic Audio Normalizer) filter is a powerful tool used to level out audio volume dynamically without causing clipping or losing perceived dynamic range. This article provides a straightforward guide on how to configure its three most critical parameters: frame length, filter window size, and target peak. By adjusting these settings, you can customize the normalization process to suit different audio types, from podcasts with spoken dialogue to highly dynamic movie soundtracks.

The dynaudnorm filter operates by analyzing audio in small segments and applying a spatially smooth gain factor. Here is how to configure the key parameters to control this behavior.

1. Frame Length (f or framelen)

The frame length parameter defines the size of each individual audio segment (in milliseconds) that the filter analyzes and processes at one time.

2. Filter Window Size (g or gaussSize)

The filter window size determines the number of neighboring frames used to calculate the Gaussian smoothing filter. This smoothing prevents abrupt volume changes between adjacent frames.

3. Target Peak (p or peak)

The target peak parameter sets the maximum peak amplitude for the output audio signal.


Command Line Examples

To apply these parameters in FFmpeg, you chain them inside the -af (audio filter) argument using colons to separate each option.

Example 1: Standard Balanced Normalization

This configuration uses default-like values suitable for general movies and TV shows, ensuring smooth transitions and safe peak levels.

ffmpeg -i input.mp4 -af "dynaudnorm=f=1022:g=31:p=0.95" output.mp4

Example 2: Aggressive Normalization for Speech/Podcasts

For speech, you want fast adaptations to keep quiet voices audible and loud voices reigned in. This setup uses a shorter frame length and smaller window size.

ffmpeg -i podcast_input.wav -af "dynaudnorm=f=500:g=15:p=0.98" podcast_output.wav

Example 3: Ultra-Smooth Normalization for Classical Music

To preserve the natural crescendo and decrescendo of music while gently leveling the overall volume, use a larger frame size and a wider Gaussian window.

ffmpeg -i music_input.wav -af "dynaudnorm=f=2000:g=101:p=0.90" music_output.wav