Apply Octave-Band Equalizer to Audio with FFmpeg

This guide explains how to use the FFmpeg command-line tool to apply an octave-band equalizer filter to an audio file. You will learn the exact command syntax, how the anequalizer filter works, and how to customize specific octave frequency bands to shape your audio’s sound profile.

Using the anequalizer Filter

FFmpeg provides a built-in audio filter called anequalizer (high-order parametric multiband equalizer). This filter allows you to configure individual bands by specifying their center frequency, band width, gain, and filter type.

To create a standard 10-band octave equalizer, you target the standard octave center frequencies: 31.25 Hz, 62.5 Hz, 125 Hz, 250 Hz, 500 Hz, 1000 Hz, 2000 Hz, 4000 Hz, 8000 Hz, and 16000 Hz.

The Command Syntax

Use the following command structure to apply a custom octave-band equalizer to your audio file:

ffmpeg -i input.mp3 -af "anequalizer=f=31.25:width_type=o:w=1:g=0:t=0|f=62.5:width_type=o:w=1:g=3:t=0|f=125:width_type=o:w=1:g=4:t=0|f=250:width_type=o:w=1:g=-2:t=0|f=500:width_type=o:w=1:g=-3:t=0|f=1000:width_type=o:w=1:g=1:t=0|f=2000:width_type=o:w=1:g=2:t=0|f=4000:width_type=o:w=1:g=3:t=0|f=8000:width_type=o:w=1:g=1:t=0|f=16000:width_type=o:w=1:g=0:t=0" output.mp3

Parameter Breakdown

Each band in the filter string is separated by a vertical bar (|) and configured using the following parameters:

Quick Alternative: The superequalizer Filter

If you do not want to manually configure every parameter for each band, FFmpeg offers a simpler alternative called superequalizer. This is a 18-band graphical equalizer with fixed frequency bands.

The bands are tuned using a sequence of numbers representing the gain (in dB) for each of the 18 bands, ranging from 30 Hz to 16000 Hz.

ffmpeg -i input.mp3 -af "superequalizer=ibpf=0 0 3 5 4 0 -2 -3 0 2 3 4 2 1 0 0 0 0" output.mp3

In this command, each number corresponds to a specific fixed band. Adjusting these values allows you to quickly shape the sound without defining frequencies or band widths manually.