How to Use FFmpeg afftdn Filter for Noise Reduction

This guide explains how to use the FFmpeg afftdn (Audio FFT Denoise) filter to remove background noise from audio tracks. You will learn the basic command structure, understand key parameters like noise reduction levels and noise types, and explore practical examples to clean up your audio files effectively.

Basic Syntax

The afftdn filter uses Fast Fourier Transform (FFT) mathematical algorithms to analyze and reduce noise. The simplest way to apply the filter to an audio file is by using the following command:

ffmpeg -i input.mp4 -af "afftdn" output.mp4

This command applies the default settings of the filter, which works well for general background hiss or white noise.

Key Parameters of the afftdn Filter

To fine-tune the noise reduction process, you can pass specific parameters to the filter using the key-value syntax: afftdn=parameter1=value1:parameter2=value2.

Practical Examples

1. Moderate Noise Reduction (Standard Hiss)

If you have a standard recording with a mild background hiss, you can increase the noise reduction slightly:

ffmpeg -i input.wav -af "afftdn=nr=15:nf=-45" output.wav

2. Targeted Pink Noise Reduction

If your background noise is lower-pitched (like a distant rumble or fan), pink noise profile targeting might yield better results:

ffmpeg -i input.mp3 -af "afftdn=nt=p:nr=18" output.mp3

3. Auditioning the Removed Noise

To ensure you are not accidentally cutting out vocal frequencies or important parts of your track, you can output only the noise that FFmpeg is removing:

ffmpeg -i input.wav -af "afftdn=nr=12:om=n" noise_only.wav

Listen to noise_only.wav. If you hear clear parts of the actual audio or speech, reduce the nr (noise reduction) value in your final command.