How to Use FFmpeg Compand Filter for Audio Expansion

This guide explains how to use the FFmpeg compand filter to apply dynamic expansion to an audio track. Dynamic expansion increases the dynamic range of an audio signal, typically by making quiet sounds quieter (downward expansion) to reduce background noise, or making loud sounds louder. Below, you will find the exact syntax, a breakdown of the key parameters, and a practical command-line example.

To configure the compand filter as an expander, you must define how the output volume level responds to the input volume level using the filter’s parameters. The basic syntax for the filter is:

compand=attacks:decays:points:[soft-threshold:[gain:[volume:[delay]]]]

Key Parameters for Expansion

Practical Example: Downward Expansion

Downward expansion reduces the volume of sounds that fall below a specific threshold. This is highly effective for reducing background noise or room hiss without completely cutting off the audio like a noise gate.

Run the following command to apply downward expansion to an audio file:

ffmpeg -i input.wav -filter:a "compand=attacks=0.1:decays=0.5:points=-80/-100|-40/-40|0/0" output.wav

How the Points Curve Works

In the example above, the points parameter is set to -80/-100|-40/-40|0/0. Here is how FFmpeg interprets these values:

Any signal between -80 dB and -40 dB is dynamically expanded (made quieter) along the slope created between these coordinates, effectively separating the unwanted noise floor from the main audio program.