fixmint
EN

Subtitles out of sync? Why they drift and how to fix the timing

By · · 4 min read

Subtitles go wrong in one of two ways. Either every line is off by the same amount, or the gap grows as the video plays. A fixed gap is fixed by shifting every line by the same number of seconds. A growing gap needs two points to be matched, or a change of frame rate, because the picture runs at a different speed from the one the subtitles were timed for. Find out which one you have before you change the file.

Fix subtitle timingSubtitles are early or lateDo it free

What a subtitle file stores

A subtitle file is a list of cues. Each cue has a start time, an end time and the text to show. The player shows a cue when the video clock reaches its start time, and hides it at the end time. A subtitle is out of sync when those times no longer match the speech in the picture.

Here is one cue in an SRT file:

1
00:00:01,000 --> 00:00:03,500
Hello, and welcome back.

The time reads hours, minutes, seconds and milliseconds. This cue shows from 1.0 second to 3.5 seconds.

A fixed gap: shift every line

If every subtitle is early or late by the same amount, the list and the video start at different points. Common causes:

  • The video was trimmed. An intro or a logo was cut from the start, but the subtitles were not.
  • The subtitles were made for another edit, such as a broadcast cut with an extra opening.
  • The file was split out of a longer video. Its clock now starts at zero, so every cue is early by the length that was cut before it.

The fix is a shift: add or subtract the same number of seconds from every cue. Add when the subtitles show too early. Subtract when they show too late. If a line appears two seconds before the speaker starts, move every cue two seconds later. Then check the first line and one near the end. If both match, the shift is right.

A growing gap: frame rate and drift

A frame rate is the number of still pictures shown per second. Film is often stored at 23.976 frames per second. Much European television plays at 25. When the same film plays at 25 frames per second, it runs about 4 percent faster, so every event happens a little earlier on the clock. The subtitles still expect the original timing.

The gap grows because the error is a percentage, not a fixed amount. At the start the subtitles are almost right. Forty minutes in, they lag by more than a minute. By the end of a 90-minute film, the lag reaches almost four minutes. Any mismatch of speed does the same thing, whether it comes from a conversion or an edit.

Fix a drift with two points

Find two lines that clearly match the speech: one near the start, one near the end. Play the video and note the moment each sentence begins in the picture. Compare that with the time in the file. Each pair gives one point, and two points give a line the file can follow.

Worked example. A line at 1:00 in the file is spoken at 1:02. Near the end, a line at 1:30:00 is spoken at 1:33:50. The stretch is (5630 − 62) ÷ (5400 − 60) = 1.0427, the same 4 percent as before. Multiply every time by 1.0427, then shift the result so the first line lands at 1:02.

Fix it with the frame rates

If you know both rates, you can skip the two points. Multiply every time by the frame rate the subtitles were timed for, divided by the video's frame rate. Subtitles timed at 25 frames per second for a 23.976 video need a factor of 25 ÷ 23.976 = 1.0427, the same stretch as the worked example.

SRT and VTT: what differs

Both formats store the same thing: a start time, an end time and the text for each cue. The differences are in the details.

SRTWebVTT (VTT)
First lineA cue numberThe word WEBVTT
Decimal markA comma: 00:00:01,000A full stop: 00:00:01.000
HoursAlways writtenCan be left out: 00:01.000
Position and styleNot in the basic formatOptional settings after the times

Web pages use WebVTT for video subtitles. Most desktop players and video editors read SRT. Converting between them keeps the timing: only the header and the decimal mark change. Do not replace every comma with a full stop by find and replace, because that also changes commas inside the subtitle text. Change only the time lines.

Find the exact frame

To check timing by eye, you need the frame where a sentence begins. A still from the video at that moment shows the picture, which helps you find the cue. Save frames as images, or make a contact sheet of the whole clip, to see several moments at once. A still shows the picture but not the sound, so listen to the line as well.

Edge cases

  • A removed scene. When a scene was cut, the gap jumps at that point instead of growing. Each half needs its own shift. Split the file at the cut and fix the two parts separately.
  • Cues before zero. A shift can push the first cue below zero. Trim those cues or move them to the start, and check the first lines of the file.
  • Only you are watching. Most video players have a subtitle delay setting. It changes the timing for that player and leaves the file alone.
  • Keep the original. Save the fixed file under a new name. The file you started with is your way back.

Comments

    No comments yet. Be the first.

    Your rating (optional)

    Your email is never shown or kept.

    Cover of Digital Workflow ToolkitDigital Workflow Toolkit

    Recipes, templates and patterns for chaining small file jobs (convert, rename, compress, merge) into workflows that run the same way every time.

    $19.00Get it on Gumroad