How to Use FFmpeg Equalizer for Bandpass EQ

This article provides a quick guide on how to configure the FFmpeg equalizer audio filter to apply a bandpass EQ effect. You will learn the correct command-line syntax, parameter definitions, and practical examples to target, boost, or isolate specific frequency bands in your audio files using FFmpeg.

In FFmpeg, the equalizer filter is a peaking equalizer that boosts or attenuates a specific frequency band. While FFmpeg has a dedicated bandpass filter for strictly isolating a frequency range, you can use the equalizer filter to create a highly customizable "bandpass EQ" shape by boosting a targeted center frequency and cutting adjacent frequencies.

The Equalizer Filter Syntax

The basic syntax for the equalizer audio filter in FFmpeg is as follows:

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

Parameter Definitions

To shape your bandpass EQ, you must configure these four primary parameters:

  • f (frequency): The center frequency of the band in Hz (e.g., 1000 for 1 kHz).
  • width_type: Determines how the bandwidth is measured. Options include:
    • h: Hz (default)
    • q: Q-factor (higher Q means a narrower band)
    • o: Octaves
  • width: The width of the band based on the chosen width_type.
  • g (gain): The amount of boost or attenuation applied to the band in dB. Positive values boost the band (bandpass effect), while negative values attenuate it (notch effect).

Practical Command Examples

1. Boosting a Specific Band (Peaking Bandpass)

To boost the mid-range frequencies around 1000 Hz by 10 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=10" output.wav

2. Using Q-Factor for Narrow Bandpass EQ

Using a higher Q-factor creates a much narrower, sharper bandpass curve. This command targets 2500 Hz with a sharp Q-factor of 2.0 and a 12 dB boost:

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

3. Chaining Multiple Equalizer Filters

To shape multiple bands simultaneously—such as boosting a desired band while cutting muddy low-end and harsh high-end frequencies—chain multiple equalizer filters separated by commas:

ffmpeg -i input.wav -af "equalizer=f=100:width_type=h:width=50:g=-10, equalizer=f=1000:width_type=h:width=200:g=12, equalizer=f=8000:width_type=h:width=1000:g=-15" output.wav

In this chained example, the low frequencies (100 Hz) and high frequencies (8000 Hz) are heavily reduced, while the mid frequencies (1000 Hz) are boosted, resulting in a customized bandpass EQ effect.