FFmpeg Cookbook
Automatically Duck BGM Under Narration with sidechaincompress
Implement audio ducking in FFmpeg with the sidechaincompress filter. Automatically lower background music whenever narration plays, with tunable threshold, ratio, attack, and release.