Split the voice with asplit, key sidechaincompress on the music with one copy, then amix: music sinks about 17 dB under speech and returns in pauses. As one ReelSDK call, an 11-second clip cost under a fifth of a cent at $0.02 per compute minute.

Duck music under a voice with ffmpeg

A threshold of 0.03 and a ratio of 8 let the voice push the music down by itself, with no volume curve to draw. ReelSDK's slideshow renderer ducks its music under voiceovers with this exact graph, a quick attack and a slower release included.

GuidesUpdated

duck
ffmpeg -i in.mp4 -i music.mp3 -filter_complex \
  "[0:a]asplit=2[vo][key];\
   [1:a][key]sidechaincompress=threshold=0.03:ratio=8:attack=15:release=350:makeup=1[duck];\
   [vo][duck]amix=inputs=2:duration=first:normalize=0[a]" \
  -map 0:v -map "[a]" -c:v copy -c:a aac -b:a 192k ducked.mp4

The voice is split in two: one copy goes into the mix, the other drives the compressor on the music. The video is copied.

Variations

The other commands you will need

  1. Check the loudness after

    ebur128 prints the integrated loudness and true peak of the result. Ours: -14.1 LUFS and -1.3 dB.

    measure
    ffmpeg -i ducked.mp4 -af ebur128=peak=true -f null -

The flags

The options in this graph

The options in this graph
FlagWhat it doesUsed here
asplit=2Makes two copies of the voice: one to hear, one to listen toGraph
[1:a][key]The music is compressed, the voice copy is the key; order mattersGraph
threshold=0.03Key level where ducking starts, about -30.5 dB; the default 0.125 is louderGraph
ratio=8How hard the music is pushed down above the threshold; the default is 2Graph
attack=15Milliseconds to duck once the voice starts; the default is 20Graph
release=350Milliseconds to come back up after it stops; the default is 250Graph
amix=...:duration=first:normalize=0Adds voice and ducked music, as long as the voice, without halving themGraph
ebur128=peak=trueMeasures loudness and true peakCheck

Sources: ffmpeg filters: sidechaincompress, ffmpeg filters: amix, checked November 2026.

How the sidechain works

sidechaincompress takes two inputs. It compresses the first, and decides how much from the level of the second. Put the music first and the voice second, and the music gets quieter exactly when the voice is loud. Swap them and you duck the voice under the music instead.

The voice is needed twice, once as the key and once in the final mix, so asplit makes the two copies. The key copy is never heard.

What it did to our clip

We compared the ducked music with the original, a tenth of a second at a time. Under speech it sat about 17 dB lower; in the pauses, only about 2 dB. That is the effect you want: the voice stays clear and the music fills the gaps.

The plain mix without the compressor peaked at -0.5 dB, close to clipping. The ducked mix came out at -14.1 LUFS with more headroom, so ducking also keeps the sum under control.

Tuning the four numbers

threshold is where the compressor starts listening. The default 0.125 only reacts to loud speech; 0.03 catches a normal voice. ratio sets how far the music goes down; 8 is a firm duck. attack and release are how fast it moves, in milliseconds. A short attack catches the first word; a longer release stops the music from pumping up between words.

These are the values our own slideshow renderer uses under voiceovers. If the music still feels loud, lower it before the compressor with volume, as in mixing audio.

Without installing ffmpeg

The same command as one API call

Send the same graph to POST /v1/ffmpeg with both URLs in inputs. Each job runs ffmpeg 8.1 on a fresh machine at $0.02 per compute minute, billed per second; this one finished in a few seconds and cost under a fifth of a cent. Our slideshow renderer ducks its music with the same graph.

terminalTry it
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
  -H "Authorization: Bearer $REELSDK_KEY" \
  --json '{
    "inputs": {
      "in.mp4": "https://api.reelsdk.com/f/lib/demo/clip.mp4",
      "music.mp3": "https://api.reelsdk.com/f/lib/music/chill/calm-currents.mp3"
    },
    "args": [
      "-i", "in.mp4", "-i", "music.mp3", "-filter_complex",
      "[0:a]asplit=2[vo][key];[1:a][key]sidechaincompress=threshold=0.03:ratio=8:attack=15:release=350:makeup=1[duck];[vo][duck]amix=inputs=2:duration=first:normalize=0[a]",
      "-map", "0:v", "-map", "[a]", "-c:v", "copy", "-c:a", "aac", "-b:a",
      "192k", "ducked.mp4"
    ],
    "outputs": ["ducked.mp4"]
  }'
Voice on top, music ducked under it and back up in the pauses: -14.1 LUFS overall. Compare the plain mix next to it.Input: 10.7-second clipplain mix, no ducking

FAQ

Questions, answered

How do I lower music when someone talks with ffmpeg?

Use sidechaincompress with the music as the first input and the voice as the second, then amix the voice back in: [0:a]asplit=2[vo][key];[1:a][key]sidechaincompress=threshold=0.03:ratio=8[duck];[vo][duck]amix=inputs=2:duration=first:normalize=0.

Why do I need asplit?

The voice feeds two places: the compressor's key input and the final mix. asplit gives each one its own copy.

Why does my ducked music pump up and down?

The release is too short, so the music jumps back between words. Raise release (we use 350 ms) or lower the ratio.

Can I duck audio with an API?

Yes. POST the same graph to https://api.reelsdk.com/v1/ffmpeg with the video and music URLs in inputs. It costs $0.02 per compute minute, billed per second, and failed jobs are free.

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains