How to Use the FFmpeg anequalizer Filter
This article provides a quick, practical guide on how to use the
anequalizer (audio equalizer) filter in FFmpeg. You will
learn the basic syntax, the meaning of its key parameters, and how to
apply real-world configuration examples to adjust your audio’s bass,
treble, and mid-range frequencies.
Understanding the anequalizer Filter
The anequalizer filter is a high-order parametric audio
equalizer. It allows you to precisely boost or cut specific audio
frequencies. Unlike simpler graphic equalizers, a parametric equalizer
gives you control over the center frequency, the gain (volume
adjustment), and the bandwidth (how wide of a frequency range is
affected).
The basic syntax for the filter is:
ffmpeg -i input.mp3 -af "anequalizer=f=FREQ g=GAIN w=WIDTH t=TYPE" output.mp3Parameter Definitions
Each frequency band configuration uses the following parameters:
f(Frequency): The target center frequency in Hz (e.g.,100for bass,1000for mids,10000for treble).g(Gain): The amount of boost or cut in dB. Positive numbers (e.g.,6) boost the frequency; negative numbers (e.g.,-6) cut it.w(Width): The bandwidth of the filter in Hz. A smaller width targets a narrow, specific frequency, while a larger width affects surrounding frequencies.t(Type): The type of filter band.0: Peaking / Bandpass (ideal for target frequencies in the mid-range).1: Low-shelf (ideal for adjusting bass below the target frequency).2: High-shelf (ideal for adjusting treble above the target frequency).
Practical Examples
1. Boosting the Bass
To boost the low-end frequencies (bass) of an audio file, use a
low-shelf filter (t=1) centered around 80 Hz with a gain
boost of 6 dB:
ffmpeg -i input.wav -af "anequalizer=f=80 g=6 w=50 t=1" output.wav2. Reducing High-Frequency Hiss (Treble Cut)
To reduce harsh high frequencies or hiss, use a high-shelf filter
(t=2) to cut frequencies above 8000 Hz by 10 dB:
ffmpeg -i input.wav -af "anequalizer=f=8000 g=-10 w=1000 t=2" output.wav3. Creating a Multi-Band Equalizer
You can apply multiple equalizer bands simultaneously by separating
each configuration block with a vertical bar (|).
The following command boosts bass at 100 Hz, cuts muddy mid-range frequencies at 1000 Hz, and boosts high-end clarity at 10,000 Hz:
ffmpeg -i input.wav -af "anequalizer=f=100 g=8 w=50 t=0|f=1000 g=-4 w=200 t=0|f=10000 g=6 w=1000 t=0" output.wav4. Applying Equalization to Specific Channels
By default, the filter applies to all channels. If you want to target
a specific channel, prefix the parameters with c0 (left
channel) or c1 (right channel):
ffmpeg -i input.wav -af "anequalizer=c0 f=1000 g=5 w=200 t=0" output.wav