How to Use the FFmpeg Equalizer Filter

This article provides a practical guide on how to use the equalizer audio filter in FFmpeg. You will learn the fundamental syntax, key parameters such as frequency, bandwidth, and gain, and see real-world examples of how to boost or cut specific audio frequencies to improve your audio files.

The equalizer filter in FFmpeg is a peaking equalizer, which means it boosts or dampens a specific frequency range around a central frequency. To apply the filter, you use the -af (audio filter) option followed by the equalizer parameter and its arguments.

Basic Syntax

The basic syntax for the equalizer filter is:

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

Key Parameters

Practical Examples

1. Boosting the Bass

To boost low-end frequencies around 60 Hz by 6 dB using a bandwidth of 20 Hz, use the following command:

ffmpeg -i input.wav -af "equalizer=f=60:width_type=h:w=20:g=6" output.wav

2. Cutting an Unwanted Hum

If your audio has an annoying hum at 1000 Hz, you can sharply cut that specific frequency by 12 dB using a narrow Q-factor of 2:

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

3. Chaining Multiple Equalizers

If you need to adjust multiple frequency bands at once, you can chain multiple equalizer filters together, separated by commas. The following command boosts the bass at 80 Hz and cuts the harsh mids at 2000 Hz:

ffmpeg -i input.wav -af "equalizer=f=80:width_type=h:w=30:g=5,equalizer=f=2000:width_type=q:w=1:g=-6" output.wav