Adjust Audio Volume by Decibels with FFmpeg
This article explains how to use the FFmpeg volume
filter to precisely adjust the audio levels of your media files using
decibels (dB). You will learn the correct command-line syntax to both
increase and decrease audio volume, while preserving the video quality
of your files without unnecessary re-encoding.
To adjust audio volume using decibels in FFmpeg, you need to use the
audio filter option, represented by -filter:a or the
shorthand -af. The volume adjustment is specified by
passing the desired decibel value followed by dB to the
volume filter.
How to Increase Audio Volume
To increase the volume, specify a positive decibel value. For example, to boost the audio by 6 decibels, use the following command:
ffmpeg -i input.mp4 -filter:a "volume=6dB" -c:v copy output.mp4How to Decrease Audio Volume
To lower the volume, use a negative decibel value. For example, to reduce the audio level by 10 decibels, run:
ffmpeg -i input.mp4 -filter:a "volume=-10dB" -c:v copy output.mp4Command Breakdown
-i input.mp4: Defines the path to your input video or audio file.-filter:a "volume=XdB": Applies the audio filter. ReplaceXwith a positive or negative number to scale the decibels.-c:v copy: Instructs FFmpeg to stream copy the video. This prevents the video from being re-encoded, which saves processing time and preserves the original video quality.output.mp4: The name of the newly generated file with the adjusted audio levels.