Fixing Audio-Video Sync Issues — -itsoffset and adelay Filter
After recording, streaming, or converting, you may encounter problems like “the lip movements don’t match the audio” or “the audio is behind/ahead of the video.” FFmpeg has several approaches to fix this sync issue. This article explains the main techniques by situation.
Verified with: ffmpeg 6.1
Identifying the Direction of the Offset
Before choosing a fix, confirm which direction the offset is in.
| Condition | Meaning | Fix |
|---|---|---|
| Audio is later than video | Sound arrives after the action | Shift audio earlier, or delay the video |
| Audio is earlier than video | Sound arrives before the action | Shift audio later |
1. -itsoffset — Offset Input Timestamps
-itsoffset adds an offset value to the timestamps of the file specified by the next -i.
Specifying a positive value causes that stream’s start to be delayed (the stream shifts back).
When audio is later than video (align audio to video)
Input the same file twice — take video from the second input and audio from the first input (with offset).
ffmpeg -itsoffset 1.5 -i input.mp4 -i input.mp4 -map 1:v -map 0:a -c copy output.mp4
Command explanation:
-itsoffset 1.5— Delays the timestamps of the next-iby 1.5 seconds (audio stream shifts back)-i input.mp4(1st) — Input with offset; audio (0:a) is taken from this-i input.mp4(2nd) — Normal input; video (1:v) is taken from this-map 1:v— Video from the second input-map 0:a— Audio from the first input (with offset applied)-c copy— Copy without re-encoding (fast, lossless)
Note:
-itsoffsetapplies to the immediately following-i. Order matters.
Meaning of positive and negative itsoffset values
| Value | Effect |
|---|---|
+1.5 (positive) | Delays that stream’s start by 1.5 seconds (shifts audio back relative to video) |
-1.5 (negative) | Advances that stream’s start by 1.5 seconds (shifts audio forward relative to video) |
2. adelay Filter — Delay the Audio
When audio is earlier than video, the adelay filter can delay the audio track by a specified number of milliseconds.
ffmpeg -i input.mp4 -filter:a "adelay=1500|1500" output.mp4
Command explanation:
adelay=1500|1500— Delays the left channel by 1500ms and the right channel by 1500ms- Use the
|separator to specify the delay per channel - For stereo audio, specifying both channels is standard
Example of setting different delays per channel
ffmpeg -i input.mp4 -filter:a "adelay=1000|500" output.mp4
(Left channel: 1000ms, Right channel: 500ms) — Not in CI scope (reference example)
3. -async Option — Automatic Sync Correction
-async is an option that automatically stretches or compresses audio samples to synchronize them with the video.
ffmpeg -i input.mp4 -async 1 output.mp4
-async 1— Automatically aligns audio to video timestamps- Useful for auto-correcting small offsets, but may change pitch
- Not suitable for large offsets (using
-itsoffsetoradelayis more accurate)
4. Difference Between aresample and async
| Option/Filter | Behavior | Use case |
|---|---|---|
-async N | Drops/pads audio based on timestamps | Automatic minor correction |
aresample filter | Re-converts sample rate | Removing subtle sync drift, unifying sample rates |
adelay filter | Adds silence to audio channels to delay them | Adding a fixed delay |
-itsoffset | Offsets the timestamps themselves | Stream-level sync adjustment |
General usage guide:
- Known fixed offset (e.g., 1.5 seconds behind) →
-itsoffsetoradelay - Small fluctuations or drift →
-async 1oraresample - Want to avoid re-encoding →
-itsoffset+-c copy
Common Notes
- When using
-c copy, theadelayfilter cannot be used (filters require re-encoding) - If the offset is large (5 seconds or more), consider reviewing the recording settings or repairing the source file first
- Determining the offset amount accurately by checking stream timestamps with
ffprobefirst is recommended (see How to Use ffprobe)
Related Articles
Tested with: ffmpeg 6.1.1 / Ubuntu 24.04 (GitHub Actions runner)
Primary sources: ffmpeg.org/ffmpeg.html / ffmpeg.org/ffmpeg-filters.html / trac.ffmpeg.org