Change AC3 Dialog Normalization with FFmpeg
This article provides a quick overview and practical guide on how to modify the dialogue normalization, or dialnorm, metadata within AC3 audio streams using FFmpeg. Adjusting this parameter allows you to control how playback systems attenuate the audio volume, ensuring consistent dialogue levels and preventing unwanted dynamic range adjustments on compatible devices.
Understanding AC3 Dialog Normalization
Dialogue normalization is a metadata tag embedded in AC3 (Dolby Digital) audio tracks. It tells compatible decoders how much to scale the audio down from 0 dBFS so that human speech remains consistent across different programs and media sources. By default, many decoders assume a value of -31 dB, which applies no attenuation, whereas other values shift the playback volume to match broadcast standards.
When you re-encode audio or want to fix quiet playback issues caused by default metadata tags, modifying the dialnorm value ensures your files play back at the intended loudness level.
Using FFmpeg to Adjust Dialnorm
FFmpeg includes built-in support for AC3 metadata controls via its
native audio encoder. To change or specify the dialog normalization
value during an encoding or transcoding operation, you can use the
-dialnorm option.
The valid range for the dialnorm parameter spans from integer values of -31 to -1, with -31 being the standard default that applies zero relative volume shift during decoding.
Example FFmpeg Command
To transcode an audio or video file and set a custom dialogue normalization value for the AC3 output stream, you can use a command structured like this:
ffmpeg -i input.mp4 -c:v copy -c:a ac3 -b:a 640k -dialnorm -31 output.mp4In this command:
-i input.mp4specifies your source media file.-c:v copycopies the video stream without re-encoding it to save time and preserve quality.-c:a ac3selects the Dolby Digital AC3 audio encoder.-b:a 640ksets the desired audio bitrate.-dialnorm -31defines the dialog normalization metadata value embedded into the output track.
By adjusting the numeric value after -dialnorm, you can
control how media players and home theater systems scale your audio
track's overall loudness relative to dialogue.