# Shift subtitle timing (https://voicelabs.now/tools/subtitle-timing-shift)

To fix subtitles that appear too early or too late, find how far off they are at one line, then move every cue by that amount: a positive number of seconds makes them later, a negative number earlier. This tool does it for .srt and .vtt files, keeps the file's format, and can shift only the cues after a given time.

Subtitles are the job of Shorty, VoiceLabs' sister product from Devino Solutions: it generates SRT and VTT subtitles from a video or audio link. Shorty's subtitle generator: https://aishorty.com/subtitles

Use the tool in a browser at https://voicelabs.now/tools/subtitle-timing-shift: no sign-up, nothing to install.

## Use it from a script

No key and no account. JSON by default, Markdown for `Accept: text/markdown`, the file itself with `download=1`.
Docs and OpenAPI: https://voicelabs.now/docs/free-tools-api

```sh
curl -s https://voicelabs.now/api/tools/subtitle-timing-shift \
  -F file=@subtitles.srt -F offset_seconds=-1.5 -F download=1 -o shifted.srt
```

## Questions

### How do I know how many seconds to shift?

Play the video to a line you can hear clearly, note the time the words are spoken, and compare it with the start time of that line in the subtitle file. If the subtitle shows at 00:01:05.000 but the line is spoken at 00:01:07.500, shift by 2.5. If it shows later than it is spoken, use a negative number.

### The subtitles start in sync and drift further off. Will a shift fix that?

Not on its own. A shift moves every cue by the same amount, so it fixes a constant offset. Subtitles that drift steadily usually come from a frame-rate mismatch (for example timings made for a 25 fps release played against a 23.976 fps one), which needs the timings scaled, not shifted. If the drift starts at one point, such as after a cut scene, shift only the cues from that point on.

### What happens to subtitles that would start before zero?

A cue that would end before 00:00:00 is removed, and one that would start before it is started at 00:00:00. Both are counted under the result, so nothing disappears unnoticed.

### Is my subtitle file uploaded?

With JavaScript on, the work happens in your browser and the file is never sent anywhere. With JavaScript off, the form sends the file to the VoiceLabs free tools API, which processes it in memory, returns the result as a download and keeps no copy.

### Which formats does it read?

SubRip (.srt) and WebVTT (.vtt). The format is detected from the file, and the result is written in the same format. To change format, use the SRT to VTT converter.
