Configure Low-Shelf and High-Shelf in FFmpeg Anequalizer
This article provides a straightforward guide on how to configure
low-shelf and high-shelf filters using the FFmpeg
anequalizer audio filter. You will learn the specific
syntax required to define these filter types, the parameters that
control their behavior, and practical command-line examples for
combining them to shape your audio’s frequency response.
Understanding the Anequalizer Filter Syntax
The anequalizer filter is a high-order parametric
equalizer. To configure shelving filters, you must define individual
bands using specific parameters. The general syntax for a single band
is:
f=frequency w=width g=gain t=type
f(Frequency): The center or cutoff frequency of the filter in Hz.w(Width): The band width in Hz.g(Gain): The gain in dB (positive values boost the signal, negative values cut it).t(Type): Specifies the filter type. This is the crucial setting for shelving filters:0: Peaking / bandpass (default)1: Low-shelf2: High-shelf
To apply a setting to a specific channel, prefix the band
configuration with c0 (channel 0/left), c1
(channel 1/right), etc. If no channel is specified, the filter applies
to all channels.
Configuring a Low-Shelf
Filter (t=1)
A low-shelf filter boosts or cuts all frequencies below the specified cutoff frequency.
To configure a low-shelf filter that boosts frequencies below 200 Hz by 6 dB, use the following syntax:
anequalizer="f=200 w=100 g=6 t=1"In this command: * f=200 sets the transition frequency
to 200 Hz. * w=100 defines a transition width of 100 Hz. *
g=6 applies a 6 dB boost. * t=1 designates the
filter type as a low-shelf.
Configuring a High-Shelf
Filter (t=2)
A high-shelf filter boosts or cuts all frequencies above the specified cutoff frequency.
To configure a high-shelf filter that cuts frequencies above 8,000 Hz (8 kHz) by 4 dB, use the following syntax:
anequalizer="f=8000 w=1000 g=-4 t=2"In this command: * f=8000 sets the transition frequency
to 8,000 Hz. * w=1000 defines a transition width of 1,000
Hz. * g=-4 applies a 4 dB cut. * t=2
designates the filter type as a high-shelf.
Combining Low-Shelf and High-Shelf Filters
You can combine multiple bands within a single
anequalizer instance by separating them with the
| (pipe) character.
The following example applies a 5 dB low-shelf boost below 150 Hz and a 3 dB high-shelf boost above 10,000 Hz across all audio channels:
ffmpeg -i input.mp3 -af "anequalizer=f=150 w=50 g=5 t=1|f=10000 w=2000 g=3 t=2" output.mp3Channel-Specific Configuration
If you want to apply the low-shelf filter only to the left channel
(c0) and the high-shelf filter only to the right channel
(c1), structure your command like this:
ffmpeg -i input.wav -af "anequalizer=c0 f=150 w=50 g=5 t=1|c1 f=10000 w=2000 g=3 t=2" output.wav