Configure FFmpeg Equalizer Frequency Bandwidth Gain

This article provides a quick guide on how to use the FFmpeg equalizer audio filter to adjust specific sound frequencies. You will learn the exact syntax and parameters required to configure the center frequency, bandwidth, and gain to boost or cut targeted frequencies in your audio files.

To configure the equalizer filter in FFmpeg, you apply the -af (audio filter) flag followed by the equalizer filter name and its three primary parameters: f (frequency), width (bandwidth), and g (gain).

The Basic Syntax

The basic structure of the equalizer filter is:

ffmpeg -i input.mp3 -af "equalizer=f=FREQUENCY:width_type=TYPE:width=WIDTH:g=GAIN" output.mp3

Parameter Breakdown

Configuration Examples

Example 1: Boosting Mid-Range Frequencies

To boost the 1000 Hz frequency by 6 dB with a bandwidth of 200 Hz, use the following command:

ffmpeg -i input.wav -af "equalizer=f=1000:width_type=h:width=200:g=6" output.wav

Example 2: Attenuating Low-End Hum (Bass Cut)

To reduce a muddy low-frequency hum at 60 Hz by 12 dB using a narrow Q-factor of 2:

ffmpeg -i input.wav -af "equalizer=f=60:width_type=q:width=2:g=-12" output.wav

Example 3: Combining Multiple Equalizer Filters

You can chain multiple equalizer filters together, separated by commas, to target multiple frequencies at once. This example boosts the bass at 100 Hz and cuts the harsh treble at 4000 Hz:

ffmpeg -i input.wav -af "equalizer=f=100:width_type=h:width=50:g=4,equalizer=f=4000:width_type=h:width=500:g=-6" output.wav