Configure FFmpeg Bass Filter Frequency and Gain
This article provides a straightforward guide on how to configure the
cutoff frequency and gain using the FFmpeg bass audio
filter. You will learn the syntax, the specific parameters required to
adjust low-frequency levels, and practical command-line examples to
boost or attenuate bass in your audio and video files.
The bass filter in FFmpeg is a shelving boost/cut filter
that targets low-frequency audio. To configure it, you primarily
manipulate two parameters: gain and
frequency.
The Bass Filter Syntax
The basic syntax for the FFmpeg bass filter is:
-af "bass=g=GAIN:f=FREQUENCY"Alternatively, you can use the short-form positional parameters:
-af "bass=GAIN:FREQUENCY"Parameter Explanations
gorgain(dB): This determines how much you want to boost or cut the bass.- Use positive values to boost the bass (e.g.,
6for +6 dB). - Use negative values to reduce the bass (e.g.,
-6for -6 dB). - The default value is
0.
- Use positive values to boost the bass (e.g.,
forfrequency(Hz): This sets the filter’s shelf/cutoff frequency. The filter will affect frequencies below this limit.- The default value is
100Hz. - The valid range is
0to99999Hz.
- The default value is
worwidth(Optional): This defines the shelf width of the filter in octaves, determines how steep the transition is, and defaults to0.5.
Practical Examples
1. Boosting Bass
To boost the bass by 8 dB for all frequencies below 80 Hz, use the following command:
ffmpeg -i input.mp3 -af "bass=g=8:f=80" output.mp32. Cutting Bass (Reducing Low-End Rumble)
To reduce low-end rumble by cutting frequencies below 120 Hz by 10 dB, use this command:
ffmpeg -i input.wav -af "bass=g=-10:f=120" output.wav3. Using Shorthand Notation
If you omit the parameter names (g= and
f=), FFmpeg expects the gain first, followed by the
frequency:
ffmpeg -i input.mp4 -af "bass=5:150" output.mp4Note: This boosts frequencies below 150 Hz by 5 dB while keeping the video track intact.