How to Remove Audio Clicks with FFmpeg adeclick

This article provides a practical guide on how to use the adeclick filter in FFmpeg to remove unwanted clicks, pops, and digital impulses from your audio files. You will learn the basic command syntax for applying the filter, understand its key parameters for fine-tuning the restoration process, and see real-world examples to achieve clean audio output.

Basic Usage of adeclick

The adeclick filter detects and interpolates click and pop noise in an audio stream. In its simplest form, you can run the filter with its default settings, which are optimized to handle most common vinyl scratches and digital dropouts.

Run the following command in your terminal:

ffmpeg -i input.wav -af adeclick output.wav

In this command: * -i input.wav specifies your input audio file. * -af adeclick applies the audio filter (-af) named adeclick. * output.wav is the resulting cleaned audio file.

Fine-Tuning adeclick Parameters

While the default settings work well for general use, you can customize several parameters to target specific types of noise or prevent the filter from altering desired transient sounds (like drum hits).

The syntax for passing options is adeclick=parameter1=value1:parameter2=value2.

Here are the most useful parameters:

1. Threshold (t)

The threshold parameter controls the sensitivity of the click detection. A lower value makes the filter more sensitive (detecting more clicks but risking false positives), while a higher value makes it less sensitive. * Default: 2.0 * Range: 1.0 to 100.0 * Example: adeclick=t=1.5 (More aggressive click detection)

2. Window Size (w)

This sets the window size in milliseconds for audio processing. Larger windows can reconstruct longer clicks but require more processing power. * Default: 55 * Range: 10 to 100 * Example: adeclick=w=30 (Shorter window for rapid, small clicks)

3. Overlap (o)

This defines the block overlap percentage. Higher overlap results in smoother interpolation but increases processing time. * Default: 75 * Range: 50 to 95 * Example: adeclick=o=85

4. Autoregressive Order (a)

The autoregressive (AR) order determines the complexity of the mathematical model used to reconstruct the lost audio during a click. Higher values can produce more natural-sounding reconstructions. * Default: 10 * Range: 0 to 25 * Example: adeclick=a=15

Practical Examples

Removing Aggressive clicks from Vinyl Rips

If you are restoring vinyl audio with heavy pops, you may want to increase the overlap and slightly lower the threshold for aggressive detection:

ffmpeg -i vinyl_rip.wav -af "adeclick=t=1.8:o=80:a=12" cleaned_vinyl.wav

Removing Light Digital Pops

For light digital sync clicks where you want to preserve the original transients of the music as much as possible, use a higher threshold:

ffmpeg -i digital_track.mp3 -af "adeclick=t=3.5:w=40" clean_track.mp3