Delay Video Relative to Audio Using FFmpeg

Audio and video desynchronization is a common issue in media processing, often requiring precise timing adjustments. This article explains how to use the -itsoffset option in FFmpeg to delay a video stream relative to its audio stream, ensuring perfect synchronization. You will learn the exact command-line syntax and how the offset parameter applies to inputs to correct timing discrepancies.

To delay the video stream relative to the audio stream, you must input the source file twice in your FFmpeg command. The -itsoffset option analyzes the input that immediately follows it and delays its start time. By mapping the audio from the original, real-time input and the video from the offset input, you achieve the desired delay.

The FFmpeg Command

Use the following command structure to delay the video by a specific number of seconds (for example, 3.5 seconds):

ffmpeg -i input.mp4 -itsoffset 3.5 -i input.mp4 -map 1:v -map 0:a -c copy output.mp4

Parameter Breakdown

By using this method, the audio will play immediately, while the video stream will start exactly 3.5 seconds later, successfully correcting the synchronization issue.