Configure FFmpeg Sidechaincompress Filter Settings

Sidechain compression is a crucial audio engineering technique used to automatically lower the volume of one audio track (the main program or carrier) whenever another audio track (the trigger or sidechain signal) plays. This is commonly used in broadcasting and video production to “duck” background music under a voiceover. This article provides a direct, practical guide on how to configure the key parameters—threshold, ratio, attack, and release—within the FFmpeg sidechaincompress filter to achieve a clean and professional audio mix.

Understanding the Core Parameters

The FFmpeg sidechaincompress filter requires specific parameters to control how and when the audio volume is reduced.

Basic Command Syntax

The sidechaincompress filter accepts two audio inputs: the first input is the audio to be compressed (e.g., background music), and the second input is the control signal (e.g., voiceover).

Here is a standard command template configuring these four parameters:

ffmpeg -i music.mp3 -i voiceover.mp3 -filter_complex "[0:a][1:a]sidechaincompress=threshold=0.1:ratio=4:attack=15:release=300[outa]" -map "[outa]" -map 1:a -c:a libmp3lame output.mp3

Parameter Breakdown of the Command:

For standard video voiceovers and podcasts, you want the music to lower quickly but return smoothly to avoid a “pumping” effect. Use the following baseline settings: