Subtitle Timing Shifter

Subtitles drift in two distinct ways and the fix is different for each. A constant lag — everything two seconds late, from the first line to the last — is an offset. A lag that grows as the file plays is a frame rate mismatch, and shifting will only ever make one end right.

Negative moves the subtitles earlier. Used in shift mode, and as an extra offset in scale mode.
Every timestamp is multiplied by this. Above 1 stretches the file longer.
Zero leaves overlaps alone and only reports them
Subtitle Timing Shifter — Shift, Stretch and Renumber SRT and VTT CuesBuildFigure

Two different faults, two different fixes

Before touching anything, find out which fault you have. Play the video, note how far the subtitles are out near the start, then jump close to the end and note it again. If the error is the same at both ends, it is constant and a shift fixes it completely. If the error at the end is larger, the file runs at a different rate to the video and no shift will ever line both ends up — you need a scale.

Scaling is usually a frame rate story. A film shot at 23.976 frames per second and transferred to a 25 frame per second broadcast standard runs about four percent faster, and subtitles authored against one run steadily out of step with the other. The presets cover the pairs that come up; the custom factor covers everything else.

Two point sync, which is the honest method

Rather than guessing at a factor, note the real time at which the first line of dialogue should appear and the real time the last one should. Two known points define exactly one linear correction: the factor is the ratio of the two intervals, and the offset is whatever is needed to put the first anchor where it belongs. That handles a file which is both late and running at the wrong rate in a single pass.

Pick the anchors as far apart as the file allows. Two points thirty seconds apart in a two hour film will amplify a small reading error into a large drift by the end, whereas anchors near the opening and the closing credits are forgiving. This is the same principle as measuring a long run with a long tape rather than stepping a short one along it.

What overlap detection is telling you

After any change, every cue is compared against the one before it. Three problems get reported. A cue that starts before the previous one ends is an overlap. A cue whose end is not after its start has no duration and will flash or vanish. A cue pushed before the start of the file by a negative shift is clamped to zero, and if several are clamped they all now start together.

None of the three is automatically fatal. WebVTT permits overlaps and positioning settings can place two cues in different parts of the frame on purpose. In a file that was clean before you touched it, though, a crop of new overlaps means the correction is wrong rather than the file being unusual, and a scale factor that is slightly off is the usual cause.

The formats are not interchangeable

SubRip writes a cue as a number on its own line, a timing line using HH:MM:SS,mmm with a comma, and one or more lines of text. WebVTT opens the file with WEBVTT, uses a period for the milliseconds, treats the number before the timing line as an optional cue identifier rather than a sequence, and allows positioning settings after the end timestamp along with NOTE, STYLE and REGION blocks that carry no timing at all.

This tool reads both and writes back in whichever it read, preserving the WebVTT header, cue identifiers, settings and the non-timing blocks. Converting between the two is more than swapping a punctuation mark, which is why nothing here pretends to do it as a side effect of retiming.

Related pages

Once the timing is right, the subtitle reading speed checker tells you whether the cues are actually readable at that duration. If you are planning the encode the subtitles will ride in, the media file size calculator covers the container. For plain text work on the dialogue itself, multi find and replace and duplicate line remover handle the usual cleanups.

Questions people ask

The subtitles are two seconds early. What do I enter?

A positive shift of 2 moves every cue later, so subtitles that appear too early need a positive number. Subtitles that appear too late need a negative one. If you get the sign wrong the drift doubles rather than disappearing, which is an unmistakable signal — reverse it and try again. Check both the start and the end of the file before committing, because a constant error is the only kind a shift can fix.

What scale factor do I need?

If you know the two frame rates, divide the source rate by the target rate — a file authored for 23.976 played against 25 needs 23.976 divided by 25, which is 0.95904. If you do not know them, use two point sync instead: note where the first and last lines should land and let the factor be derived. That works even when the mismatch is not a standard rate pair.

Why did I get overlaps after scaling?

Scaling multiplies both the start and the end of every cue, so a file that was tight before becomes tighter when compressed and looser when stretched. A factor below 1 pulls cues together and can push a long cue into the next one. The minimum gap setting will separate them mechanically, but it does so by moving start times, which is a patch rather than a fix — a slightly different factor is usually the real answer.

Does this work on WebVTT?

Yes. The format is detected from the WEBVTT header, timestamps are read with either a period or a comma, and the output is written back in the format it came in with the header, cue identifiers, positioning settings and NOTE blocks preserved. What it will not do is convert one format into the other, because that involves more than the timestamps.

Should I renumber the cues?

For SubRip, generally yes — players are lenient about the sequence numbers but some tools are not, and a file that has been edited by hand often has gaps or repeats. For WebVTT the number before a timing line is an identifier that a stylesheet or a script can refer to, so renumbering can break a reference. The checkbox only rewrites SubRip sequence numbers; WebVTT identifiers are left alone.

Related