Why Audio Goes Out of Sync
Audio that doesn't match the video is one of the most disorienting viewing experiences possible. A half-second offset makes the video feel dubbed. A progressive drift that starts off by 100ms and ends 2 seconds late by the end of the file makes even a short video unwatchable.
Audio sync problems fall into two categories:
Constant offset: The audio is consistently early or late by the same amount throughout the entire video. This is the easier case — you shift the audio track by a fixed amount and everything lines up.
Variable drift: The audio gradually gets earlier or later relative to the video as playback progresses. This happens when the audio and video have different effective sample rates or when combining footage from different sources with slightly different timing. Fixing this requires adjusting the audio tempo (speeding up or slowing down the audio without changing pitch) or re-encoding with corrected timing.
Understanding which type you have determines which fix to apply.
Diagnosing the Type of Sync Problem
Testing for Constant Offset
Watch the first 30 seconds and the last 30 seconds of the video. Note the lip sync delay at each point.
- Same delay throughout? → Constant offset. Easy to fix.
- Different delay at start vs. end? → Variable drift. More complex fix needed.
A common test: watch someone clap their hands on screen. The clap sound should coincide with the hands touching. If it's consistently half a second late throughout the video, you have a constant offset of +500ms on the audio.
Measuring the Offset
To measure a precise offset:
- Find a moment with a sharp, unambiguous audio event — a clap, door slam, or gunshot
- Note the timecode where the visual event occurs
- Note where the audio event occurs
- Subtract: (audio timecode) - (video timecode) = audio offset
If audio is at 0:30.500 and video is at 0:30.000, the audio is 500ms late. Use a negative offset to pull audio back in time: -itsoffset -0.5.
Method 1: FFmpeg (Fixed Offset)
FFmpeg handles constant offset correction without re-encoding the video track, preserving full quality.
Audio Too Late (Delayed Behind Video)
If dialogue happens after the lips move, the audio needs to move earlier in time:
# Audio is 500ms behind video — shift audio 500ms earlier
ffmpeg -i input.mp4 -itsoffset -0.5 -i input.mp4 \
-map 0:v -map 1:a -c copy output_fixed.mp4
The trick here uses two input instances: the first provides the video stream, the second provides the audio stream with an offset applied. The -itsoffset flag shifts all streams from the next input file by the specified number of seconds (negative = earlier, positive = later).
Audio Too Early (Ahead of Video)
If sound happens before what you see on screen:
# Audio is 300ms ahead of video — delay audio 300ms
ffmpeg -itsoffset 0.3 -i input.mp4 -i input.mp4 \
-map 1:v -map 0:a -c copy output_fixed.mp4
Here the audio (first input) gets delayed by 0.3 seconds relative to the video (second input).
Simpler Method (Using audio_delay)
For most cases, the audio filter approach is simpler to reason about:
# Delay audio by 500ms (audio is currently 500ms early)
ffmpeg -i input.mp4 -itsoffset 0.5 -i input.mp4 -map 0:v -map 1:a -c copy output.mp4
# Or using the adelay filter (more explicit)
ffmpeg -i input.mp4 -vf copy -af "adelay=500|500" -c:v copy output.mp4
The adelay=500|500 adds 500ms of silence to both left and right audio channels.
Container vs. Stream Timestamps
Some sync issues come from incorrect timestamps in the container rather than actual content offset. This is common with recordings from certain cameras and screen capture software:
# Fix timestamp inconsistencies (often resolves mysterious sync issues)
ffmpeg -i input.mp4 -c copy -fflags +genpts output_fixed.mp4
# More aggressive timestamp correction
ffmpeg -i input.mp4 -c copy -avoid_negative_ts 1 output_fixed.mp4
Try these before applying manual offsets — they sometimes fix the problem without needing to measure an offset.
Method 2: Fixing Variable Drift (Audio Tempo Adjustment)
Variable drift usually comes from a mismatch between the audio sample rate and the effective playback rate. For example, audio captured at 44,100 Hz but the container says 48,000 Hz — the audio plays back too fast and drifts ahead of video over time.
Identifying the Drift Rate
If the video is 60 minutes long and ends 2 seconds out of sync:
- Drift rate: 2 seconds / 3600 seconds = 0.000556 (0.056% speed difference)
- Correction factor: 1 / (1 + 0.000556) = 0.999444
Applying Audio Tempo Correction
# Slow down audio by 0.05% to correct drift
# atempo range: 0.5 to 100.0 (1.0 = no change)
ffmpeg -i input.mp4 -vf copy -af "atempo=0.99944" -c:v copy output_drift_fixed.mp4
atempo changes playback speed without affecting pitch. This is the correct tool for drift correction — do not use asetrate (which changes the reported sample rate and introduces pitch artifacts).
Calculating the Exact Atempo Value
# Given: video_duration seconds, audio ends N seconds late
video_duration = 3600 # seconds
drift = 2.0 # audio ends 2 seconds late (ahead of video = negative)
# If audio is running fast (ends early), it needs to slow down
# If audio is running slow (ends late), it needs to speed up
correction = video_duration / (video_duration + drift)
print(f"atempo value: {correction:.6f}")
# Output: atempo value: 0.999444
For large drifts (audio more than 10% out of sync), use multiple atempo filters chained:
# atempo is limited to 0.5-2.0; chain for larger corrections
ffmpeg -i input.mp4 -af "atempo=0.8,atempo=0.8" -c:v copy output.mp4 # 0.64x speed
Method 3: VLC (No Re-encoding, Playback Adjustment)
For a one-time viewing without fixing the file, VLC lets you adjust audio delay on-the-fly:
Keyboard shortcuts during playback:
J— Move audio 50ms earlierK— Move audio 50ms later
Hold repeatedly until lips and sound match. VLC will display the current offset at the top of the screen. Unfortunately, VLC doesn't save this offset to the file — it's a playback-only fix.
For a permanent fix in VLC: Tools > Track Synchronization. Set "Audio track synchronization" to the measured offset value, then use Convert/Save to re-encode with that delay applied.
Method 4: KDEnlive and DaVinci Resolve (Timeline-Based Fixes)
For video files that will be edited further, timeline-based editors handle sync correction more intuitively.
In KDEnlive:
- Import the video
- Ungroup the audio and video tracks
- Shift the audio track left (audio is late) or right (audio is early)
- Use the "Razor" tool to trim any gap this creates at the start
In DaVinci Resolve:
- Import the clip to the timeline
- Right-click the clip > Clip Attributes
- Adjust the "Audio Offset" field (in frames or timecode)
Both approaches are non-destructive — the original file doesn't change. Export creates a new file with the sync applied.
Method 5: Using the Audio Bitstream Directly
Some sync issues occur because the audio bitstream has incorrect timestamps embedded in it (common with AC3/Dolby audio from certain camcorders):
# Remux without re-encoding but reset all timestamps
ffmpeg -i input.mp4 -c copy -map 0 -reset_timestamps 1 output_fixed.mp4
# If the video has multiple audio tracks, specify which to keep
ffmpeg -i input.mp4 -c:v copy -c:a copy -map 0:v:0 -map 0:a:0 output.mp4
Diagnosing Sync Issues in Specific Scenarios
Converted Video Files
Conversion between formats sometimes introduces sync problems, particularly when converting:
- MKV to MP4 (different container timestamp handling)
- AVI to MP4 (AVI has a fixed 29.97fps assumption that breaks other frame rates)
- Files from non-standard cameras
For recently converted files, the -fflags +genpts approach often resolves it. If you're converting files and experiencing sync issues, use the MP4 converter which handles timestamp normalization automatically.
Screen Recordings
Screen recordings that show audio drift typically have a sample rate mismatch between the audio capture device and the encoding settings. OBS Studio and similar tools can produce files where the audio was captured at 44.1 kHz but encoded to a container that assumes 48 kHz.
Fix: Re-encode the audio, explicitly setting the correct sample rate:
# Re-encode audio to 48000 Hz (the video standard)
ffmpeg -i screen_recording.mp4 -c:v copy -c:a aac -ar 48000 -b:a 192k output.mp4
Live Streaming Archives
Twitch, YouTube, and Facebook Live archives sometimes have sync issues from network packet loss or encoding hiccups during the live stream. These produce variable drift that can't easily be corrected with a simple offset. The best approach is to find a fixed-sync section, measure the offset at that point, and apply a constant correction that makes the most critical moments (usually the beginning) sync correctly.
Phone Video + External Microphone
Recording with a phone's camera while using an external Bluetooth microphone introduces Bluetooth latency (typically 150-300ms). The audio from the Bluetooth mic arrives later than the video that was recorded simultaneously. Fix: apply a constant offset of approximately -200ms to the audio track and fine-tune from there.
Checking and Verifying Stream Timestamps
To understand why a file has sync issues, inspect the stream timestamps:
# Show audio and video stream info
ffprobe -v quiet -print_format json -show_streams input.mp4 | \
python3 -c "import sys,json; [print(s['codec_type'], s.get('r_frame_rate',''), s.get('sample_rate',''), s.get('start_time','')) for s in json.load(sys.stdin)['streams']]"
# Show detailed packet timestamps (first 20 packets)
ffprobe -v quiet -print_format compact -show_packets -read_intervals "%+#20" input.mp4
Comparing the start_time values for audio and video streams often reveals the source of a sync problem immediately.
Common Sync Issues Reference
| Symptom | Likely Cause | Fix |
|---|---|---|
| Audio consistently behind video | Audio delay setting in capture software | Fixed offset (adelay) |
| Audio consistently ahead of video | Audio pre-roll, incorrect start time | Fixed negative offset |
| Starts OK, drifts late by end | Audio sample rate mismatch | atempo correction |
| Starts OK, drifts early by end | Frame rate mismatch | atempo correction |
| Works in VLC, broken elsewhere | Container timestamp issues | -fflags +genpts |
| Audio skips or glitches | Corrupt packets | Re-encode audio |
| Silent audio track | Wrong audio codec for container | Transcode audio |
For the extract audio use case — when you need the audio track for separate use — the extract audio from video guide covers that workflow in detail.
Frequently Asked Questions
How do I fix audio sync in a video without re-encoding?
Use FFmpeg's stream copy mode (-c:v copy -c:a copy) with the -itsoffset flag. This changes the presentation timestamp in the container without decoding or re-encoding any stream, so there's no quality loss and processing is very fast — typically a few seconds for any file length.
Can I fix audio sync in an MP4 without any software?
Not without software — you need to write a new file with corrected timestamps. However, the ffmpeg commands in this guide run on any platform (Windows, macOS, Linux) and are free. For online alternatives, some tools like Clideo's video editor handle fixed-offset sync correction in the browser.
What if the audio sync varies at different points in the video?
Variable sync requires either atempo (for smooth, gradual drift) or timeline-based editing software where you can manually align sections. There's no single-pass fix for truly variable sync — it means the audio and video have fundamentally different timing that requires segment-by-segment correction.
Does fixing audio sync affect video quality?
Only if you re-encode the video. The FFmpeg stream copy method (-c:v copy) copies the video bitstream byte-for-byte with no quality change. The atempo approach requires re-encoding the audio but not the video.
How do I check if my fixed file actually has correct sync?
After applying the fix, play the result in VLC and find a moment with clear audio-visual synchronization cues (clap, door slam, sharp consonant sounds). If the fix is correct, these events will coincide within 50ms, which is the threshold of human perception for audio-video sync.
Conclusion
Most audio sync problems fall into two categories that require different approaches. Constant offsets need a timestamp shift — fast, lossless with FFmpeg's stream copy mode. Variable drift needs tempo correction with atempo to gradually realign the audio timeline with video.
For quick one-off fixes, the FFmpeg commands in this guide run in seconds. For videos that need further editing, bring the file into a timeline editor (DaVinci Resolve, Kdenlive) where you can visually align tracks. Use the video compressor after fixing sync if you also need to reduce file size, and the video converter hub for any format changes needed alongside the sync correction. The remove audio from video guide covers scenarios where you need to replace the audio track entirely rather than just shifting it.


