How to Use FFmpeg Bandreject Filter to Remove Frequencies

This article explains how to use the bandreject audio filter in FFmpeg to isolate and eliminate a specific range of unwanted frequencies from an audio file. You will learn the core syntax, the key parameters (such as center frequency and bandwidth), and practical command-line examples to effectively remove hums, buzzes, or specific interference from your audio tracks.

The bandreject filter in FFmpeg is an audio filter that attenuates a narrow band of frequencies around a specified center frequency, allowing all other frequencies outside of this band to pass through. This is particularly useful for notch filtering, which targets precise noises like a 50 Hz or 60 Hz electrical hum.

The Basic Syntax

To apply the bandreject filter, use the -af (audio filter) flag in your FFmpeg command. The basic structure of the filter is:

ffmpeg -i input.mp4 -af "bandreject=f=FREQUENCY:width_type=TYPE:w=WIDTH" output.mp4

Key Parameters

The bandreject filter relies on three main parameters to define the frequency range you want to eliminate:

Practical Examples

Example 1: Removing a 1000 Hz tone with a 200 Hz width If you have a constant whistle at 1000 Hz and want to mute the range from 900 Hz to 1100 Hz, use the following command:

ffmpeg -i input.wav -af "bandreject=f=1000:width_type=h:w=200" output.wav

Example 2: Precision filtering using Q-factor For a highly surgical cut that removes an exact frequency while minimizing damage to surrounding audio, use a high Q-factor. This command removes a 60 Hz hum with a Q-factor of 2.0:

ffmpeg -i input.mp3 -af "bandreject=f=60:width_type=q:w=2" output.mp3

Combining Multiple Filters

If you need to remove multiple distinct frequency ranges, you can chain multiple bandreject filters together, separated by commas:

ffmpeg -i input.wav -af "bandreject=f=120:w=10,bandreject=f=240:w=15" output.wav

Using these configurations, you can easily clean up your audio tracks by targeting and suppressing problematic frequencies using FFmpeg.