How to Boost Bass in FFmpeg Using the Bass Filter
This article provides a quick and practical guide on how to use
FFmpeg’s built-in bass audio filter to boost low-end
frequencies in your audio and video files. You will learn the basic
command syntax, how to adjust parameters like gain and frequency, and
see real-world examples to help you achieve a richer, deeper sound.
Understanding the Bass Filter Syntax
The bass filter in FFmpeg is an equalizer filter
designed to boost or cut the low-frequency response of an audio stream.
It uses a low-shelf filter configuration.
The basic syntax for applying the filter is:
-af "bass=g=GAIN:f=FREQUENCY:w=WIDTH"Key Parameters:
g(gain): The amount of boost (or attenuation) in decibels (dB). To boost the bass, use a positive number (e.g.,8for +8 dB). The range is -20 to +20. The default is 0.f(frequency): The center or cutoff frequency in Hz where the filter is applied. The default is100Hz.w(width): The shelf width or slope of the filter. It determines how gradually the filter transitions. The default is0.5(representing a Q-factor or octave bandwidth).
Practical Examples
1. Basic Bass Boost
To apply a simple 8 dB bass boost to an audio file using the default frequency of 100 Hz, use the following command:
ffmpeg -i input.mp3 -af "bass=g=8" output.mp32. Customizing Frequency and Gain
If you want to boost sub-bass frequencies (for example, targeting 60
Hz with a 10 dB boost), you can specify both the g and
f parameters:
ffmpeg -i input.wav -af "bass=g=10:f=60" output.wav3. Boosting Bass in a Video File
If you are working with a video file (like an MP4) and want to boost the bass without re-encoding the video stream, copy the video codec and apply the audio filter:
ffmpeg -i input.mp4 -c:v copy -af "bass=g=6" output.mp44. Combining Bass Boost with Volume Normalization
Boosting the bass increases the overall amplitude of the audio, which
can sometimes cause digital clipping (distortion). To prevent this, you
can chain the volume filter to lower the overall volume
slightly, or use the anequalizer alongside it:
ffmpeg -i input.mp3 -af "bass=g=8,volume=-2dB" output.mp3