Audio that leads the picture by 45 milliseconds is already detectable to a viewer, while audio that trails it doesn't register until roughly 125 milliseconds, according to international broadcast research published in the ITU-R BT.2044 report. That asymmetry is the most useful single fact in this problem, because it destroys the idea of one universal sync number. A blanket rule that shifts audio by a fixed amount is too late in one direction and too early in the other.
Most advice stops at nudging a track until the lips look right. That works for one file, one time, when the error is constant and you happen to guess the sign correctly. It falls apart the moment the gap grows across the file, or when the cue you should be matching isn't a mouth at all but a whoosh, a caption change or a beat.
Fixing audio video sync reliably comes down to three measurements: which direction the sound is off, how large the gap is, and whether that gap holds from the first frame to the last. Get those and the repair is usually a copy-based timestamp shift that takes seconds. Skip them and you burn a full re-encode on a problem that was never an encoding problem.
Table of Contents
- Sync Error Thresholds Worth Knowing
- Measure the Offset Before You Change Anything
- Constant Offset or Progressive Drift
- Repair Offset and Drift with FFmpeg
- Short-Form, Dubbed and Off-Screen Cues
- Run Sync Checks Across a Batch
- Confirm the Fix Before You Publish
Sync Error Thresholds Worth Knowing
Delivery standards set the outer bounds, and they are not the number a viewer uses. ATSC IS-191 caps audio leading video at 15 ms and lagging at 45 ms at the digital-TV encoder input, according to a technical reference on lip-sync standards. Those limits are taken at the encoder, before distribution. They stay tight because every stage after the encoder can add its own error.
| Reference | Audio leads video | Audio lags video |
|---|---|---|
| Perceptual detection threshold (broadcast research) | about 45 ms | about 125 ms |
| ITU-R BT.1359-1 end-to-end tolerance | +90 ms | −185 ms |
| ATSC IS-191 at digital-TV encoder input | 15 ms | 45 ms |
Read the table in two passes. First find the sign: is the sound ahead of the picture or behind it? Then compare the magnitude against the row that matches the delivery target. The ITU-R BT.1359-1 end-to-end tolerance is far looser than the ATSC encoder-input limit, and it is looser than the point where a viewer first notices a problem, while the ATSC limit is tighter than that point.
That spread is why professional delivery works to a stricter limit than audiences would tolerate. A viewer can register a modest lip offset and still not call the program broken. A reviewer with a stopwatch and a client will.
Practical rule: establish the sign before you argue about the size. Forty milliseconds of audio leading is a different defect from forty milliseconds of audio lagging, and only one of those sits inside a typical broadcast limit.
These thresholds are the yardstick, not the delay you type into a filter. The same absolute gap can sit inside one row and outside another, depending on whether the sound leads or lags. I treat a constant offset that is already inside the row you are shipping to as a timestamp problem: shift the start, leave the samples alone. A gap that grows across the file is a different defect. Moving the start time will not hold it inside the limit from the first frame to the last, and a re-encode will not fix a number you have not signed yet.
Short-form cuts use the same yardstick on different cues. An impact, a caption change, or a beat is a valid sync target when there is no mouth to read. Match that cue's sign and magnitude to the row you have to meet. If the offset is constant and inside the lead or lag allowance, do not spend a re-encode on it.
Measure the Offset Before You Change Anything
A number you can defend beats a nudge you can't repeat. The measurement loop is short, and it works on any file you can open.

- Find a cue that exists in both picture and sound. A clap, a door slam, a hard consonant spoken with the lips closed, or a visible impact all work. A title card or a quiet room gives you nothing to measure and a false zero you'll trust.
- Read frame numbers, not a playhead estimate. Scrub frame by frame in a player that displays frame counts, note the frame where the action peaks, then find the sample where the audio spike peaks. Frame-accurate reading is the difference between a 40 ms fix and a 90 ms guess.
- Run ffprobe and read the stream headers. A single command prints
start_time,sample_rateandr_frame_ratefor each stream, and a stream that starts at 0.2 seconds explains the offset before you've measured anything at all. The ffprobe tutorial on stream inspection walks through the flags worth keeping. - Subtract the video start time from the audio start time. A positive result means the audio starts late and needs to move earlier. A negative result means it's early. Write the sign down; it's the half of the answer people drop.
- Repeat the cue check at the start, middle and end. Three numbers, not one. Equal gaps at all three points mean a constant offset. A gap that grows means drift, and no single delay value will fix it.
- Record the values before you change the file. You need the same cue, at the same frames, to prove the repair worked. Without that baseline you're judging by feel on the second pass.
Why the header check comes before the nudge
Container and stream start times explain a large share of offsets that look like encoder bugs. When the audio stream's first packet is stamped later than the video's, every sample downstream inherits that shift, and the fix is a timestamp operation rather than a re-encode.
The common slip is measuring on silence. If the first audible event in your clip is 300 ms in and you measure there, you'll conclude the file is perfect while the actual speech is 80 ms out. Pick a cue with a sharp transient in both domains and measure that same cue three times.
Constant Offset or Progressive Drift
Say a clip is 120 ms off at the first second and 400 ms off at the end. A single -itsoffset sized to the opening gap fixes the head and leaves the tail 280 ms out, which is well past the point where a viewer notices. The correction looked right when you checked it and wrong by the time you shipped it.
That's the trap with fixed delays. The Tools for Film guide on out-of-sync audio makes the same point: shifting the audio track only addresses a constant offset, while drift requires changing the timing itself. Drift usually traces back to mismatched sample rates, mismatched frame rates, or variable-frame-rate footage, and each of those needs a different repair.
| Pattern | What You See | Likely Cause | First Check |
|---|---|---|---|
| Constant offset | Same gap at start, middle and end | Capture or container delay | Measure one offset and shift one stream |
| Linear drift | Gap grows over the length of the file | Mismatched audio sample rate or frame rate | Compare sample rate and frame rate of each stream |
| Step change | Sync breaks at one timestamp | Dropped or duplicated frames, or an edit point | Check PTS and DTS continuity around that time |
| Variable frame rate | Sync wobbles or drifts | Phone or screen recording with VFR | Check whether the frame rate is variable |
A fixed delay is a guess about the future. On a drifting file, that guess gets worse with every minute of runtime.
The decision rule that follows from the table is short. If the gap is the same at three points, shift one stream and copy the rest. If it grows, normalize the audio sample rate to a consistent production rate such as 48 kHz and convert variable frame rate material to a controlled constant timeline before muxing, which is exactly the normalization step the frame rate conversion guide covers in detail. If it breaks at one timestamp, inspect PTS and DTS around that point before you touch the audio at all, because the audio is probably fine and the timeline isn't.
Don't apply the same offset to every file in a queue. Encoder, decoder, capture and frame-processing delays differ per source, so a value that rescues one upload will damage the next.
Repair Offset and Drift with FFmpeg
Work from the cheapest repair to the most expensive, and stop as soon as the cue lands inside tolerance.
- Shift one stream for a constant offset.
ffmpeg -i input.mp4 -itsoffset 0.125 -i input.mp4 -map 0:v -map 1:a -c copy output.mp4delays the audio by 125 ms with no re-encode. Use a negative value only when the audio is early, and keep the video mapped from the original input so the picture is untouched. - Resample when the gap grows.
-af "aresample=async=1:first_pts=0"lets the async logic stretch or squeeze samples so audio follows the timeline instead of sliding away from it. This is the fix for a source whose capture rate doesn't match the timeline it's being muxed into. - Force a constant frame rate for VFR sources.
-fps_mode cfr -r 30(older builds use-vsync cfr) rebuilds the video timeline at a fixed cadence before muxing. Afterwards, check that the output frame count matches the expected duration, because a silent mismatch here reintroduces drift you thought you'd removed. - Re-encode only when a copy-based fix fails. A re-encode costs time and adds generation loss, and it rarely repairs a problem that is purely a timestamp disagreement.
- Validate against the same cue. Repeat the start, middle and end measurements and compare stream durations with the original. Keep the original file until all three checks pass.

What the timestamps are actually doing
MPEG-based containers carry presentation timestamps that tell a decoder when each audio block and video frame should be shown, plus decoding timestamps that order the decode when B-frames reorder frames, both on a 90 kHz clock that gives fine granularity against ordinary frame durations (audio-to-video synchronization overview). A constant offset is a PTS shift. Drift means the timeline itself has to be rebuilt, which is why resampling and frame-rate conversion sit in a different category from -itsoffset.
That's also why a timestamp fix can't rescue a file whose timing was already broken during an earlier conversion or preprocessing step. If the metadata was written wrong upstream, correct the metadata or re-time the stream; don't stack another offset on top.
When you speed a clip up, timing both streams in the same command keeps them locked: setpts=0.5*PTS on the video with atempo=2.0 on the audio doubles playback speed without separating sound from picture.
Short-Form, Dubbed and Off-Screen Cues
Lip sync is the wrong test for most vertical video. In a nine-by-sixteen clip with a beat drop, a hand slap and a caption burn, the timing that matters is the beat, the impact and the caption change, and a face may never appear. Recent research on temporally streaming audio-visual synchronization notes that much prior work concentrates on speech and lip alignment, which leaves event cues largely untested even though they're what viewers feel.
A clip can pass a lip-sync check and still feel wrong, because the whoosh lands after the hand has already left the table.
The fix is to test each cue separately. Measure speech-to-mouth alignment wherever a face is visible, then measure the event cues on their own: the frame of the impact against the audio transient, the subtitle change against the spoken word, the beat against the cut. For dubbed or generated voice tracks, align the new track to the timing of the original mouth movements or the scene cut rather than to the start of the file, since a start-anchored offset will drift away from every subsequent cut.
When one segment is off and the rest is correct, trim or re-time that segment alone. Shifting the whole track to rescue thirty seconds of a two-minute clip pushes everything else out.
Human-judged references are catching up to this. A 2024 synchrony benchmark published by the PEAVS researchers on arXiv contains more than 120,000 human annotations across over 100 hours of content, the kind of labelled set that covers non-speech cues rather than only clean talking heads (PEAVS benchmark study).
Run Sync Checks Across a Batch
The single-file method scales if you treat it as a loop: extract, measure, route, verify. Each file gets a waveform and a handful of keyframes pulled out, the offset gets measured at three points, and the numbers decide the branch.

Take ten uploads. Six come back with equal gaps at all three points and go straight to a copy-based shift. Three drift, so they take the resample and constant-frame-rate path before muxing. One breaks at a single timestamp, which sends it to a PTS and DTS inspection rather than an audio fix. Only the low-confidence files, the ones where the measurement disagrees with itself, go to a person.
Log the command and the three measured numbers per file. When a job fails a spot check three weeks later, the log tells you which timestamp broke and which repair ran, and you can reverse it instead of re-deriving it.
Batch rule: route on the pattern, not on the file name. The measurement decides the branch, every time.
Running this at volume is mostly plumbing. You submit a job by sending a POST request with your FFmpeg command and input and output file mappings, and the endpoint returns immediately with a command_id while the processing runs in the background. RenderIO downloads your inputs, runs FFmpeg in an isolated container, and uploads the outputs, so the same measured command applies across the queue. The batch processing best practices guide covers how to structure those jobs.
Confirm the Fix Before You Publish
Run the checklist before anything leaves the machine.
- Three cue measurements. Start, middle and end, all inside the tolerance for your delivery target, not just the one you happened to check.
- Stream durations and start times. Compare the output against the original so nothing was cut short or padded out by the repair.
- First and last ten seconds on headphones. Numbers miss the artifacts your ears catch, especially at splice points.
- The command, written down. A logged command plus the measured offsets makes the fix repeatable and reversible.
- Originals kept. Side by side with the corrected file until the batch passes.
Once a sample of the batch clears that list, apply the identical command to the rest. Full FFmpeg 7.x runs on MP4, WebM, MOV, AVI, MKV, H.264, H.265, VP9, AV1, AAC, MP3, FLAC, WAV, PNG, JPEG, GIF and WebP, so the same repair carries across the formats in a mixed queue without a per-container rewrite.
The discipline that pays off is the boring one: measure the sign and magnitude, name the pattern, pick the cheapest repair that addresses it, and prove it against the same cue you started with.
RenderIO runs any FFmpeg 7.x command through a single REST endpoint, so the sync repair you validated on one file can be applied to an entire batch without managing servers or re-encoding anything that only needed a timestamp shift. Post your command with the input and output mappings, track the job by its command_id, and get full FFmpeg stderr back when a measurement surprises you. Start with a sample file at RenderIO and scale the same command across your queue once it passes.