Fix a constant subtitle timing offset without changing the text
When subtitles are consistently early or late, shifting each cue by the same amount can restore alignment. If the discrepancy grows throughout the video, a single shift is not enough. Measure multiple matching events before editing.
Published: · Updated:
Read the SRT timeline
SRT is a text format with numbered cues, start and end timestamps and caption text. A timestamp such as 00:00:01,000 represents one second. The comma separates milliseconds from seconds. The playback program uses those values to decide when the caption appears and disappears.
Measure fixed offset versus drift
Choose clear spoken events near the start, middle and end of the video. Note the intended and actual times. Similar errors at all three positions suggest a constant offset; changing errors may indicate an edit, a different source duration or a rate mismatch. Do not assume the frame rate is always the cause.
Apply one signed time shift
When captions appear early by 750 ms, add 750 ms to both the start and end of every cue. When they appear late by that amount, subtract it instead. Preserve cue text, duration and ordering. Inspect any cue that would cross time zero or extend beyond the intended video.
Check the result during playback
Preview the same events again with the corrected file. Check that speech, meaningful sound descriptions and caption text still correspond. A timestamp parser can check the file structure but cannot establish that a human finds the captions readable or that they match actual speech.
Compare a synthetic SRT pair
- Open captions-original.srt and captions-shifted.srt in a plain text editor.
- Inspect the first cue: the original starts at 00:00:01,000 and ends at 00:00:02,500.
- The shifted cue starts at 00:00:01,750 and ends at 00:00:03,250; both boundaries are 750 ms later.
- Repeat for all three cues. Confirm the order, text and durations remain unchanged.
All three synthetic cues were shifted by 750 ms, with identical cue durations and text. This confirms a constant timestamp edit, not synchronization to actual speech.
Independent laboratory results
Test date:
All three synthetic cues were shifted by 750 ms, with identical cue durations and text. This confirms a constant timestamp edit, not synchronization to actual speech.
- Original and shifted subtitles (ZIP)
learn-caption-timing-pair.zip - Measured cue timestamps (JSON)
learn-caption-timing-results.json
3 cues; Δt = +750 ms00:00:01,000 → 00:00:01,75000:00:02,500 → 00:00:03,250Δduration = 0 ms
Independent check: Python / independent Node.js SRT parser