How to Apply High-Pass Filter in FFmpeg
This article provides a quick, step-by-step guide on how to use the FFmpeg command-line tool to apply a high-pass filter to an audio file. You will learn the exact command needed to eliminate low-frequency background noise and rumble below 80Hz, helping you achieve cleaner and more professional audio tracks.
The Basic Command for 80Hz Cutoff
To remove low-end rumble below 80Hz from an audio file, use FFmpeg’s
audio filter (-af) flag with the highpass
filter. Run the following command in your terminal:
ffmpeg -i input.mp3 -af "highpass=f=80" output.mp3Command Breakdown
-i input.mp3: Specifies the path to your input audio file.-af "highpass=f=80": Applies the audio filter.highpassis the filter name, andf=80sets the cutoff frequency to 80 Hz. Any frequencies below this threshold will be attenuated.output.mp3: The name of the newly created, filtered audio file.
Increasing the Filter Steepness (Poles)
By default, the high-pass filter in FFmpeg uses a single-pole filter,
which has a gentle roll-off. If you still hear low-end rumble, you can
make the cutoff steeper by increasing the number of poles using the
p parameter.
The number of poles can be set from 1 to 20 (the default is 2). To apply a sharper, double-pole cutoff at 80Hz, use this command:
ffmpeg -i input.mp3 -af "highpass=f=80:p=2" output.mp3Applying the Filter to Video Files
If you are working with a video file and want to filter the audio without re-encoding the video track, you can copy the video stream directly. This saves processing time and preserves video quality:
ffmpeg -i input.mp4 -vcodec copy -af "highpass=f=80" output.mp4