How to Use the FFmpeg Dynaudnorm Filter

This article provides a practical guide on how to use the dynaudnorm (Dynamic Audio Normalizer) filter in FFmpeg. You will learn what the filter does, its basic syntax, key parameters you can customize, and real-world command examples to normalize your audio dynamically without losing quality or causing clipping.

The dynaudnorm filter is an advanced audio filter in FFmpeg used for dynamic range compression and volume normalization. Unlike standard normalization, which applies a single gain adjustment to the entire file, dynaudnorm changes the volume dynamically over time. This is highly useful for video and audio files with inconsistent volume levels, such as movies where whispered dialogue is too quiet and action scenes are too loud.

Basic Syntax

To apply the dynamic audio normalizer with its default settings, use the -af (audio filter) flag followed by dynaudnorm:

ffmpeg -i input.mp4 -af dynaudnorm output.mp4

This command automatically analyzes the audio in real-time and adjusts the volume to a comfortable, balanced level throughout the duration of the file.

Key Parameters

You can fine-tune the behavior of dynaudnorm by passing specific parameters. The syntax for passing parameters is dynaudnorm=parameter1=value:parameter2=value.

Practical Examples

Example 1: Smooth Normalization for Movies If you want a smoother transition between loud and quiet parts, increase the frame length (f) and the window size (g):

ffmpeg -i input.mkv -af "dynaudnorm=f=1000:g=51" output.mkv

Example 2: Restricting Maximum Gain To normalize a podcast or voice recording without heavily amplifying background room noise during silences, limit the maximum gain (m) to 3.0:

ffmpeg -i podcast.mp3 -af "dynaudnorm=m=3.0" output.mp3

Example 3: Normalize Audio and Copy Video Stream If you are processing a video file and only want to modify the audio without re-encoding the video, use the -c:v copy option. This saves a significant amount of processing time:

ffmpeg -i input.mp4 -af dynaudnorm -c:v copy output.mp4