How to Use the Lowpass Filter in FFmpeg
This guide provides a straightforward explanation of how to use the
lowpass audio filter in FFmpeg to reduce high-frequency
noise and smooth out audio tracks. You will learn the basic syntax, key
parameters like cutoff frequency, and practical command-line examples to
apply this filter to your media files.
Understanding the Lowpass Filter
The lowpass filter in FFmpeg allows frequencies below a
specified cutoff frequency to pass through while attenuating (reducing
the volume of) frequencies above that cutoff. This is highly useful for
removing high-pitched hissing, wind noise, or sibilance from voice
recordings.
Basic Syntax
To apply the lowpass filter, you use the -af (audio
filter) flag followed by lowpass and its parameters.
The most basic command structure looks like this:
ffmpeg -i input.mp3 -af "lowpass=f=3000" output.mp3In this example, f=3000 sets the cutoff frequency to
3000 Hz. All audio frequencies above 3000 Hz will be significantly
quieted.
Key Parameters
You can customize the filter using the following parameters, separated by colons:
frequency(orf): Specifies the cutoff frequency in Hz. The default value is 3000 Hz.poles(orp): Sets the number of poles for the filter, which determines the steepness of the cutoff. Allowed values are even integers from 2 to 48 (default is 2). A higher number of poles results in a sharper reduction of frequencies above the cutoff.width_type(ort): Defines how the filter width is specified (e.g., in Hz, octaves, or Q-factor).width(orw): Sets the band-width of the filter.
Practical Examples
Example 1: Applying a sharp cutoff for voice clarity To limit a voice recording to a maximum of 4000 Hz with a steep slope (using 4 poles) to eliminate sharp background noise:
ffmpeg -i interview.wav -af "lowpass=f=4000:p=4" cleaned_interview.wavExample 2: Processing audio within a video file If
you want to apply the lowpass filter to a video file without re-encoding
the video stream, use the -c:v copy option:
ffmpeg -i input.mp4 -af "lowpass=f=2500" -c:v copy output.mp4This command filters the audio at 2500 Hz while preserving the exact quality of the original video.