Change AC3 Dialog Normalization with FFmpeg
This guide explains how to change the dialog normalization (dialnorm) level in an AC3 (Dolby Digital) audio stream using FFmpeg. You will learn how to modify this metadata value losslessly using bitstream filters, as well as how to set it when encoding new AC3 audio from scratch.
Method 1: Modify Existing AC3 Streams Losslessly (No Re-encoding)
The fastest and most efficient way to change the dialog normalization
level is by using FFmpeg’s bitstream filter (ac3_metadata).
Because this method only edits the metadata, it does not re-encode the
audio, preserving the original quality and completing the process
instantly.
To set the dialog normalization to -31 (which
effectively disables any volume attenuation by the receiver), use the
following command:
ffmpeg -i input.mkv -map 0 -c copy -bsf:a ac3_metadata=dialnorm=-31 output.mkvCommand Breakdown: * -i input.mkv:
Specifies the input video/audio file. * -map 0: Selects all
streams from the input file. * -c copy: Copies all video
and audio streams without re-encoding them. *
-bsf:a ac3_metadata=dialnorm=-31: Applies the AC3 metadata
bitstream filter to the audio streams, changing the
dialnorm value to -31.
Method 2: Set Dialog Normalization During Encoding
If you are converting an audio source (such as DTS, AAC, or WAV) to
AC3, you can set the dialog normalization level directly during the
encoding process using the -dialnorm flag.
Use the following command to encode an audio file to AC3 with dialog
normalization set to -31:
ffmpeg -i input.wav -c:a ac3 -dialnorm -31 output.ac3Command Breakdown: * -c:a ac3: Selects
the FFmpeg native AC3 encoder. * -dialnorm -31: Sets the
target dialog normalization level for the output stream.
Understanding Dialog Normalization Values
Dialog normalization in AC3 is measured in dBFS (decibels relative to
full scale) and typically ranges from -31 to
-1.
- -31 dB: This is the maximum setting. It tells the decoder that the dialog is already at peak level, resulting in 0 dB of attenuation (the audio plays at its original, maximum volume).
- -27 dB: This is the standard Dolby Digital default. It tells the playback device to reduce the overall volume by 4 dB.
- -1 dB: This represents the lowest setting, resulting in maximum attenuation (30 dB of volume reduction).