What an SRT file is made of

An SRT file is a list of numbered blocks. Each block has three parts: a number, a start and end time written as hours:minutes:seconds,milliseconds, and one or two lines of text. A blank line ends the block.

329
00:24:22,584 --> 00:24:23,784
absence ...

A video player reads only the times. It shows the text from the start time to the end time and ignores everything else. That is why a translation can read perfectly and still play badly: the words are fine, but they are attached to the wrong times.

The three ways a translation breaks the timing

These examples are from our test of four long jobs, where three chat models each translated the same 1,200-line, 85-minute SRT file into Spanish in one reply.

1. A line is folded into the one before it. The original had "...take advantage of Lady Bracknell's temporary" in line 328 and "absence ..." in line 329. One model put the whole sentence in line 328 and deleted line 329. On screen, "absence" now appears a second early, and line 329's time slot is empty.

2. Everything after a dropped line is renumbered. The same model then numbered the rest of the file from 329 onward without a gap. After a second fold at line 357, 870 of the 1,200 lines had a different number than in the original. The file still plays. But if you or your editor compare the translation with the original by line number, every line after 329 is matched with the wrong one.

3. One digit in a time code changes. Another model wrote 00:54:55,839 --> 00:54:51,039 for a line that was 00:54:45,839 --> 00:54:51,039. The line now ends before it starts. Depending on the player, it is skipped, flashes for no time, or makes the file fail to load.

A whole-file shift, where every line is off by the same amount from the very first line, is a different problem: the subtitles were made for another cut or frame rate of the video. Translation does not cause that.

The 2-minute check

Open the original and the translation side by side in any text editor.

  1. Last line. Jump to the end of both files. The last number and the last time code should be identical. If the translation ends at 1,198 and the original at 1,200, two lines were folded or dropped.
  2. Three lines from the middle. Search the translation for three time codes taken from the original, at roughly a quarter, half and three quarters of the way through. Each should have the same number in both files. The first place the numbers differ is where a line went missing.
  3. Impossible times. Look for any line whose end time is earlier than its start time. In a long file, a small script or a subtitle editor's error check finds these instantly.
  4. The last ten minutes. Load the translation in your player and jump near the end. If the lines appear on time there, the file is very likely fine.

If you have Python, this short script runs checks 1 to 3 on any pair of files (python3 srtcheck.py original.srt translated.srt). On the three translations from our test it reported exactly the errors described above.

import re, sys

def cues(path):
    text = open(path, encoding="utf-8-sig").read().replace("\r", "")
    return re.findall(r"^(\d+)\n(\d\d:\d\d:\d\d,\d{3}) --> (\d\d:\d\d:\d\d,\d{3})", text, re.M)

a, b = cues(sys.argv[1]), cues(sys.argv[2])
print(f"lines: {len(a)} original, {len(b)} translated")
print(f"last:  {a[-1]} vs {b[-1]}")
times = {(s, e): n for n, s, e in a}
renumbered = sum(1 for n, s, e in b if (s, e) in times and times[(s, e)] != n)
changed = [n for n, s, e in b if (s, e) not in times]
broken = [n for n, s, e in b if e <= s]
missing = [n for n, s, e in a if (s, e) not in {(s2, e2) for _, s2, e2 in b}]
print(f"renumbered: {renumbered}, changed time codes: {changed[:10]}, "
      f"end before start: {broken[:10]}, original lines missing: {missing[:10]}")

If the translation passes all four, use it. If it fails one, it is usually faster to translate again with a tool that keeps the timing than to fix the file by hand.

Line length is a separate check

Translations into Spanish, German or French often run longer than the English. Netflix's English (USA) style guide allows 42 characters per line and two lines per subtitle. In our test, the share of translated lines with a line longer than 42 characters ranged from 32 to 447 out of 1,200, depending on the model. Our own tool produced 105, so this is worth checking whatever you use: long lines are hard to read, but they do not break the timing.

How to avoid the problem

The errors above happen because the model is asked to write the numbers and times back out along with the translation. Keep them out of its hands. Our subtitle translator reads your .srt or .vtt file, sends only the text in blocks of up to 60 lines, asks again for any line that comes back missing, and copies every number and time from your original. On the same 1,200-line test file, all 1,200 lines came back with identical numbers and time codes.

The first part of every job is free and needs no account. A whole movie or season, up to 5,000 lines in up to 30 files, is $5, paid once. Popular targets have their own pages: SRT to Spanish, Arabic and Persian.

Method & data

Sources

  1. SubRip (SRT file format) — Wikipedia
  2. English (USA) Timed Text Style Guide — Netflix Partner Help Center
  3. Timed Text Style Guide: General Requirements — Netflix Partner Help Center