How to Fix Subtitle Sync Drift: Offsets, Frame Rates and Variable Frame Rate Video

Why subtitles slide out of sync and how to fix it: diagnose offset, linear drift and VFR problems, then repair timings with FFmpeg, a subtitle editor or a script.

Captions & SubtitlesBy AI Point EditorialUpdated 24 September 20269 min read

Subtitles that are out of sync by the same amount throughout have an offset problem, which you fix by shifting every timing. Subtitles that start in sync and get steadily worse have a drift problem, which is almost always caused by a frame-rate or speed mismatch and needs the timings stretched, not just shifted. Subtitles that go in and out of sync unpredictably usually point to a different edit of the video or to variable frame rate footage. The fix depends entirely on which one you have, so diagnose first.

Step 1: diagnose the pattern

Open the video and the subtitle file together in a player such as VLC or mpv. Check three points: a line near the start, one in the middle and one near the end. For each, note roughly how early or late the subtitle is.

What you see Pattern Most likely cause
Same error everywhere (e.g. 2 s late at start, middle and end) Constant offset Intro, logo or silence added or removed at the start
Correct at start, error grows steadily towards the end Linear drift Frame-rate or speed mismatch
Correct in places, jumps out of sync at specific points Stepped offset Scenes cut, added or re-ordered in a different edit
Wanders in and out with no clear pattern Irregular drift Variable frame rate video, or a broken audio track

Write the numbers down. Two accurate measurements, one early and one late, are all you need to fix the two most common problems.

Constant offset: shift everything

This is the easy case. If every subtitle is 2.5 seconds late, subtract 2.5 seconds from every timing.

FFmpeg can do this for SRT files with the -itsoffset option, which applies an offset to the input that follows it:

ffmpeg -itsoffset -2.5 -i captions.srt -c copy captions_fixed.srt

A negative value makes subtitles appear earlier; a positive value makes them later. Check the first few cues in the output. If a negative shift would push the first cue before zero, FFmpeg can re-anchor the whole file so that cue starts at zero, which shifts every cue by less than you asked; in that case use a subtitle editor or the shifter below instead.

If you prefer not to use the command line, our SRT shifter shifts SRT and VTT timings in the browser, and every desktop subtitle editor has an equivalent "adjust all times" function. In Subtitle Edit it sits with the other synchronisation tools.

Many media players can also shift subtitles temporarily during playback (in VLC, the G and H keys adjust subtitle delay by default). That is useful for measuring the offset, but it does not change the file.

Linear drift: the frame-rate problem

Linear drift means the subtitles and the video run at slightly different speeds. The classic cause is a mismatch between 23.976, 24 and 25 frames per second.

Here is why. Film and a lot of online content is made at 24 fps or 23.976 fps. Traditional UK and European television runs at 25 fps, and film shown in that format has historically been sped up by about 4% to fit, with the audio sped up to match. If subtitles were timed against one version and played against the other, every timing is out by the same proportion. The error is small at the beginning and large by the end.

You can recognise it from the numbers:

  • 25 ÷ 23.976 ≈ 1.0427, a difference of about 4.3%. Over a 45-minute programme that is nearly two minutes of error.
  • 24 ÷ 23.976 ≈ 1.001, about 0.1%. Over an hour that is roughly 3.6 seconds, easy to mistake for a small offset until you check the end.

Our guide to frame rates explains where these rates come from and why the UK uses 25 and 50.

Other causes of linear drift include audio that was resampled incorrectly, an export at a slightly different speed, and subtitles converted between formats with a wrong frame-rate setting (formats that count frames rather than milliseconds are particularly vulnerable).

Fixing linear drift with two-point sync

You do not need to know the cause to fix linear drift. You need two reference points: a subtitle near the start and one near the end, with their current times and the times they should be.

Suppose:

  • Cue 3 currently starts at 00:00:12.000 but the line is spoken at 00:00:11.500.
  • Cue 410 currently starts at 00:41:30.000 but the line is spoken at 00:39:48.000.

Every time needs to be transformed as new = scale × old + offset. From the two points:

scale  = (2388.0 - 11.5) / (2490.0 - 12.0) = 2376.5 / 2478.0 ≈ 0.95904
offset = 11.5 - 0.95904 × 12.0 ≈ -0.0085 s

A scale of about 0.959 is almost exactly 23.976 ÷ 25, which confirms a frame-rate mismatch.

Subtitle Edit offers this as "Point sync", where you pick two cues and type the correct times, and also has a "Change frame rate" option if you already know the two rates. Aegisub users can apply the same arithmetic with its timing tools. To do it in code:

import re

def to_s(t):
    h, m, s = t.replace(",", ".").split(":")
    return int(h) * 3600 + int(m) * 60 + float(s)

def to_ts(x):
    x = max(0.0, x)
    h, rem = divmod(x, 3600); m, s = divmod(rem, 60)
    return f"{int(h):02}:{int(m):02}:{s:06.3f}".replace(".", ",")

# (current time, correct time) for an early and a late cue
(a_old, a_new), (b_old, b_new) = (12.0, 11.5), (2490.0, 2388.0)
scale = (b_new - a_new) / (b_old - a_old)
offset = a_new - scale * a_old

pat = re.compile(r"(\d\d:\d\d:\d\d,\d\d\d) --> (\d\d:\d\d:\d\d,\d\d\d)")
src = open("captions.srt", encoding="utf-8-sig").read()
out = pat.sub(lambda m: f"{to_ts(scale * to_s(m[1]) + offset)} --> "
                        f"{to_ts(scale * to_s(m[2]) + offset)}", src)
open("captions_synced.srt", "w", encoding="utf-8").write(out)
print(f"scale={scale:.5f} offset={offset:.3f}s")

Pick reference cues that are clearly spoken, not overlapping music or crosstalk, and as far apart as possible. The further apart they are, the more accurate the scale.

Stepped offset: a different edit

If the subtitles are perfect for ten minutes and then suddenly five seconds late, a section was added, removed or moved. No single shift or stretch can fix this. Split the file at each jump and shift each section separately, or re-time the affected sections against the audio waveform in a subtitle editor.

This is common when captions are made from a rough cut and the video is re-edited afterwards. The reliable prevention is to caption the locked final export, not an earlier version, and to re-export captions from the edit timeline if your editor supports it.

Irregular drift: variable frame rate

Phone cameras, screen recorders and some game-capture tools often record variable frame rate (VFR) video: the time between frames changes depending on load and lighting. Some editing software and players handle VFR well; others assume a constant rate, which causes audio and subtitles to wander relative to the picture.

Check the frame-rate mode with MediaInfo, which reports "Frame rate mode: Variable", or compare the average and nominal rates with ffprobe:

ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate,avg_frame_rate -of default=nw=1 input.mp4

If r_frame_rate and avg_frame_rate differ noticeably (for example 30/1 against 29.3), the file is probably VFR.

The cure is to convert the video to a constant frame rate before editing and captioning:

ffmpeg -i input.mp4 -fps_mode cfr -r 30 -c:v libx264 -crf 18 -c:a aac -b:a 192k input_cfr.mp4

Older FFmpeg builds use -vsync cfr in place of -fps_mode cfr. Pick the frame rate you intend to edit at. Then caption the converted file. Our essential FFmpeg commands guide covers re-encoding options in more detail, and the >FFmpeg documentation lists every option.

Automatic sync tools

Open-source tools such as ffsubsync and alass compare subtitle timings with the speech detected in the audio and calculate a correction automatically. They work well for offset and linear drift on clean dialogue, and they can save a lot of time on long videos. Results are less reliable with heavy music, long silences or many speakers, so always spot-check the start, middle and end afterwards.

Another route is simply to regenerate timings. If you have a correct transcript, forced alignment or a fresh speech-recognition pass on the final audio will produce accurate timings from scratch; see word-level timestamps for how that works.

Quick checklist

  • Measure the error at the start, middle and end before changing anything.
  • Same error everywhere: shift all timings.
  • Error growing steadily: two-point sync (scale plus offset), or a frame-rate conversion.
  • Sudden jumps: a different edit; fix section by section.
  • Random wandering: check for VFR and convert to constant frame rate.
  • Keep the original file, and save the corrected version under a new name.
  • Check the result at three points, then run a reading speed check, because stretching changes durations.

FAQ

Why are my subtitles perfect at the start but late at the end?

That is linear drift, usually from a frame-rate mismatch such as 23.976 against 25 fps. Shifting will not fix it; you need to stretch the timings using two reference points or a frame-rate conversion.

Can I fix sync in YouTube Studio?

YouTube Studio's subtitle editor lets you adjust individual caption timings, which is fine for small corrections. For a whole-file offset or drift, it is quicker to fix the file on your computer and upload it again.

Will changing the video's frame rate fix my subtitles?

Only if the subtitles were timed against the version you are converting to. Usually it is better to leave the video alone and re-time the subtitles, unless the video is VFR, in which case converting to a constant frame rate is the right first step.

Does stretching subtitle timings affect reading speed?

Slightly. A 4% stretch changes every caption's duration by 4%, which is rarely noticeable, but it can push a few already-fast captions over your limit. Run a speed check after any large correction.

Software, platform rules and settings change. We review our guides regularly, but always check the official documentation for the tools you use. Found an error? Email soubickdas@gmail.com. See our editorial policy.
A

AI Point Editorial

We build caption, transcription and video-workflow tools and write about what we learn doing it — practical, tested and free of hype.