Configure afftdn Noise Reduction Strength in FFmpeg
This article provides a quick guide on how to configure and adjust
the noise reduction strength using the afftdn (Audio FFT
De-noise) filter in FFmpeg. You will learn about the key parameters that
control the filter’s intensity, along with practical command-line
examples to help you achieve the optimal balance between noise removal
and audio quality.
The afftdn filter in FFmpeg is a powerful, non-linear
audio bandpass filter that uses Fast Fourier Transforms to reduce
background noise. To control the strength of this noise reduction, you
primarily adjust the noise_reduction parameter.
The Key Parameter:
noise_reduction (or nr)
The noise_reduction parameter (abbreviated as
nr) defines the amount of noise reduction applied to the
signal in decibels (dB).
- Default value: 12 dB
- Value range: 0.01 to 97 dB
A higher value results in more aggressive noise reduction, which is useful for highly corrupted audio but may introduce “musical noise” or watery-sounding digital artifacts. A lower value preserves more of the original audio character while leaving some background hiss.
Practical Command Examples
To apply the filter, use the -af (audio filter) flag in
your FFmpeg command.
1. Default Noise Reduction (12 dB)
If you do not specify any parameters, FFmpeg applies the default strength of 12 dB:
ffmpeg -i input.mp3 -af "afftdn" output.mp32. Gentle Noise Reduction (6 dB)
For clean audio with only a faint hiss, a lower setting preserves the high frequencies and natural dynamics:
ffmpeg -i input.mp3 -af "afftdn=nr=6" output.mp33. Strong Noise Reduction (24 dB)
For noisy environments or loud constant hums, you can increase the reduction strength:
ffmpeg -i input.mp3 -af "afftdn=nr=24" output.mp3Advanced Fine-Tuning
To get the best results from the afftdn filter, you can
combine the noise reduction strength with the noise floor parameter:
noise_floor(ornf): Sets the noise floor in dB (default is -50 dB, range is -120 to -20 dB). Adjusting this helps FFmpeg distinguish between actual signal and background noise.
For example, to apply 18 dB of noise reduction with a custom noise floor of -40 dB:
ffmpeg -i input.mp3 -af "afftdn=nr=18:nf=-40" output.mp3