How to Fix Out-of-Sync Subtitles: Shift Timing, Frame Rate and Offsets
Subtitles early, late or slowly drifting? Diagnose constant offset vs drift, then fix it in a player, an editor or the SRT file itself.
Try it now: AI Subtitle Generator — timed subtitles from speech in 20 languages, processed in your browser.
Subtitles that appear at the wrong time are almost always one of three problems. Name the problem first, and the fix is quick.
Step 1: Diagnose
Play the video and note the offset (how early or late the subtitle is) at two points: near the start and near the end.
| What you see | Problem | Fix |
|---|---|---|
| Same offset at start and end (e.g. 2 s late both times) | Constant offset | Shift all times by that amount |
| Offset grows (0.2 s at start, 5 s at the end) | Drift (frame rate or speed mismatch) | Rescale the times, or re-generate from the right video |
| Offset jumps at a point | An edit/cut between the subtitle source and the video | Split the file at the jump and shift each part |
| Only the first few lines are wrong | A leading intro or countdown | Shift from that line onward |
Fix 1: Constant offset
In the player (just for you). Most players let you nudge subtitle delay while playing. Useful for measuring, but it does not fix the file.
In the file. Add or subtract the offset from every timestamp. Doing it by hand across hundreds of lines is error-prone. Use an editor with a global shift, or a small script. WebVTT and SRT differ in the separator (, vs .), so convert carefully; see SRT vs VTT.
A minimal sketch in JavaScript for shifting an SRT by ms milliseconds:
function shiftSrt(text, ms) {
const re = /(\d{2}):(\d{2}):(\d{2}),(\d{3})/g;
return text.replace(re, (_, h, m, s, f) => {
let t = ((+h * 60 + +m) * 60 + +s) * 1000 + +f + ms;
t = Math.max(0, t);
const pad = (n, w) => String(n).padStart(w, "0");
return `${pad(Math.floor(t / 3600000), 2)}:${pad(Math.floor(t / 60000) % 60, 2)}:${pad(Math.floor(t / 1000) % 60, 2)},${pad(t % 1000, 3)}`;
});
}Negative ms shifts earlier; the clamp stops times going below zero.
Fix 2: Drift
Drift happens when the subtitles were made for a version of the video that runs at a different speed, for example a different frame rate or a PAL/NTSC conversion. A fixed shift cannot fix it. Options:
- Generate the captions from the exact video you are publishing. This is the cleanest fix, and the reason to caption the final export, not an earlier cut.
- Rescale: pick two reference lines (one early, one late), measure each offset, and scale all times linearly between them. Subtitle editors usually have a "synchronise" or "stretch" feature.
Fix 3: Edit the timing at the source
If you made the captions in the GenKit Lab editor, you can adjust each caption's start and end on its timeline against the audio waveform, then export again. See the caption editor guide. The editor needs a free Google sign-in; edits are saved automatically on your device.
Prevent it next time
- Caption the final render, not a rough cut.
- Do not change the video after captioning without re-checking.
- Preview in a player before you upload; see previewing in VLC.
- If you hand-edit the file, keep the structure intact; see SRT file structure.
When captions come from a generator such as the subtitle generator, timing is based on the speech in the video you gave it, so a mismatch usually comes from using the file with a different version of the video.
Last updated