How to Delay Specific Audio Channels with FFmpeg adelay

This guide demonstrates how to use the FFmpeg adelay filter to apply precise time offsets to individual audio channels in a multi-channel or stereo stream. You will learn the underlying syntax of the filter, how channel mapping works, and practical command-line examples for common scenarios like stereo and 5.1 surround sound.

Understanding the adelay Filter Syntax

The adelay filter applies a delay to each audio channel individually. The delays are mapped sequentially to the channels in the input stream (e.g., Channel 1, Channel 2, Channel 3).

The basic syntax is:

-af "adelay=delay_ch1|delay_ch2|delay_ch3..."

Delaying Channels in a Stereo Stream

In a standard stereo stream, the channel order is: 1. Left (Channel 1) 2. Right (Channel 2)

Example 1: Delay the Right Channel Only

To delay only the right channel by 1.5 seconds (1500 milliseconds) while keeping the left channel playing instantly, use:

ffmpeg -i input.mp4 -af "adelay=0|1500" -c:v copy output.mp4

Example 2: Delay the Left Channel Only

To delay only the left channel by 500 milliseconds, set the first parameter to 500 and the second to 0:

ffmpeg -i input.mp4 -af "adelay=500|0" -c:v copy output.mp4

Delaying Channels in a 5.1 Surround Sound Stream

For multi-channel layouts like 5.1 surround sound, the standard layout order in FFmpeg is: 1. FL (Front Left) 2. FR (Front Right) 3. FC (Front Center) 4. LFE (Low-Frequency Effects / Subwoofer) 5. BL (Back Left) 6. BR (Back Right)

To target a specific channel, you must specify the delay for all preceding channels in the list, even if those delays are 0.

Example 3: Delay the Center Channel Only

To delay only the Front Center (FC) channel by 2 seconds, apply 0 delays to Front Left and Front Right, and 2000 to Front Center:

ffmpeg -i input.mkv -af "adelay=0|0|2000" -c:v copy output.mkv

(Note: You do not need to specify trailing zeros for the LFE, BL, and BR channels; FFmpeg will automatically apply a 0ms delay to any omitted trailing channels).


Delaying All Channels Simultaneously

If you want to apply the same delay to all channels in the stream without writing out the values for each channel, use the all parameter:

ffmpeg -i input.mp4 -af "adelay=delays=1s:all=1" -c:v copy output.mp4

This delays every audio channel in the input stream by exactly 1 second.