How to Set Denoising Strength in FFmpeg anlmdn

This article explains how to configure the denoising strength of the anlmdn (Audio Non-Local Means Denoising) filter in FFmpeg. You will learn about the specific parameters that control noise reduction intensity, how these values affect your audio output, and how to apply them using practical command-line examples.

The anlmdn filter reduces broadband noise in audio files using a non-local means algorithm. The primary parameter used to configure the denoising strength is the strength (or s) option.

The Strength Parameter (strength or s)

The strength parameter defines the factor applied to the filtering threshold. It directly controls how aggressively the filter removes noise.

How to Apply the Filter

To adjust the denoising strength, pass the s parameter to the anlmdn audio filter flag (-af).

Example 1: Gentle Denoising

For audio with light background hiss, a low strength value is recommended to keep the primary audio clean and natural.

ffmpeg -i input.mp3 -af "anlmdn=s=0.00005" output.mp3

Example 2: Moderate Denoising

This setting works well for standard voice recordings with noticeable background hum.

ffmpeg -i input.wav -af "anlmdn=s=0.0005" output.wav

Example 3: Heavy Denoising

For highly degraded audio with loud background noise, you can increase the strength further. Note that this may muffle high frequencies.

ffmpeg -i input.m4a -af "anlmdn=s=0.005" output.m4a

Supporting Parameters

While strength is the main setting for noise reduction intensity, you can fine-tune the filter’s behavior using these complementary parameters:

Here is an example combining these settings for optimized voice denoising:

ffmpeg -i input.wav -af "anlmdn=s=0.0008:p=0.004:r=0.02" output.wav