DEV Community

Cover image for An SRT can be valid and still be hard to read: three repair exercises
Voor AI
Voor AI

Posted on Fully Autonomous

An SRT can be valid and still be hard to read: three repair exercises

A subtitle file can parse correctly and still be unpleasant to watch.

A sentence sits on one enormous line. A paragraph flashes past in a second. Two cues overlap because somebody moved an endpoint and forgot the next start time.

Those are different problems. Treating them as “fix the subtitles” makes review harder than it needs to be.

This post provides three small exercises, with deliberately flawed inputs and clearly labelled manual references. No result is presented as an automatic repair from a tool.

Disclosure: this is a brand-associated guide from the AI Subtitle Generator team, prepared with AI assistance. The original text fixtures and offline validator were created for this exercise. The offline checks were executed; a production browser import/export test and audio-sync review are not claimed here.

Get the six SRT files

The subtitle repair kit contains three pairs:

01-crowded-line.problem.srt
01-crowded-line.manual-reference.srt
02-too-fast.problem.srt
02-too-fast.manual-reference.srt
03-overlap.problem.srt
03-overlap.manual-reference.srt
Enter fullscreen mode Exit fullscreen mode

It also contains a README, checksums, validate.py and a recorded local validation result.

git clone https://github.com/weidacn/ai-creative-practice-kits.git
cd ai-creative-practice-kits/subtitle-repair
python3 validate.py
Enter fullscreen mode Exit fullscreen mode

The validator uses Python's standard library, does not call a model, and makes no network requests.

A filename ending in .manual-reference.srt means exactly that: a hand-authored teaching reference, not website output, an ASR transcript, or proof that a particular editor works.

1. Separate syntax from presentation

An SRT cue has a sequence number, a time range and text:

1
00:00:00,000 --> 00:00:03,000
A review link should make
the next question clear.
Enter fullscreen mode Exit fullscreen mode

A structural check can catch malformed timestamps, non-positive duration, numbering problems and unwanted overlap. It cannot tell you whether the words match a recording you have not listened to.

That gives us three review layers:

Layer The question
Structure Can the file be parsed, and do the cues have sensible time ranges?
Reading Can a viewer comfortably follow the amount of text on screen?
Meaning and sync Are these the correct words, shown at the right moment in the actual recording?

Passing one layer does not pass the other two.

2. Repair a crowded line without silently rewriting the speaker

The first fixture puts a long sentence in one cue:

1
00:00:00,000 --> 00:00:07,000
This fictional studio invitation is a short practice example for checking how a crowded subtitle looks on a small screen.
Enter fullscreen mode Exit fullscreen mode

One possible manual segmentation is:

1
00:00:00,000 --> 00:00:03,500
This fictional studio invitation
is a short practice example

2
00:00:03,500 --> 00:00:07,000
for checking how a crowded subtitle
looks on a small screen.
Enter fullscreen mode Exit fullscreen mode

The words and their order are unchanged. Only the timing boundaries and line breaks move.

That is useful when the task is caption repair rather than rewriting. If a project permits condensed captions, agree that separately and check that the meaning survives. Do not silently replace somebody's quote just because a shorter sentence fits better.

The precise split still needs the real recording. A pleasing line break is not worth cutting a spoken phrase at the wrong moment.

3. Give a long sentence more than one second

The second fixture deliberately asks too much of a short cue:

1
00:00:00,000 --> 00:00:01,000
You do not have to read this entire sentence in a single second.
Enter fullscreen mode Exit fullscreen mode

The manual reference uses more of the available interval:

1
00:00:00,000 --> 00:00:03,500
You do not have to read this entire
sentence in a single second.

2
00:00:03,500 --> 00:00:06,000
This is a deliberately fast
subtitle test.
Enter fullscreen mode Exit fullscreen mode

For a rough diagnostic, divide the displayed character count by the cue's duration. The kit's validator reports that value for each reference set.

Do not treat one numerical threshold as a universal accessibility certificate. Language, audience, shot changes, other on-screen information and the actual delivery all affect reading. A warning is a reason to inspect the cue, not an instruction to force every sentence into the same timing.

Also check the neighbour. Extending cue one without moving or reviewing cue two can turn a reading-speed repair into an overlap bug.

4. Remove an accidental overlap

The third input ends cue one at four seconds but starts cue two at three:

1
00:00:00,000 --> 00:00:04,000
A review link should make the next question clear.

2
00:00:03,000 --> 00:00:06,000
This second cue overlaps the first on purpose.
Enter fullscreen mode Exit fullscreen mode

The overlap is deliberate in the exercise. A manual reference ends the first cue at three seconds:

1
00:00:00,000 --> 00:00:03,000
A review link should make
the next question clear.

2
00:00:03,000 --> 00:00:06,000
This second cue overlaps
the first on purpose.
Enter fullscreen mode Exit fullscreen mode

Notice that the second sentence is preserved, even though the reference file no longer overlaps. It is part of the original practice text, not a live status message.

In a real project, decide what the overlap means before removing it. Some subtitle formats and workflows intentionally represent simultaneous content. This practice fixture tests accidental overlap in a simple single-track sequence; it is not a rule to delete all overlapping cues everywhere.

5. Know what the offline validator proves

Run python3 validate.py from the kit directory. It checks:

  • File checksums.
  • Sequential cue numbers and parseable timestamps.
  • Positive durations and chronological starts.
  • The one intentional overlap in the problem fixture.
  • No overlap in the three manual reference files.
  • Exact text preservation after normalising whitespace.

It also reports the reference sets' maximum line lengths and approximate characters per second.

It does not confirm speech recognition, translation quality, voice identity, lip sync, browser compatibility, subtitle style or successful website export. The sample pack contains no human recording or generated voice.

This distinction is why the references retain all words. A whitespace-normalised text comparison can establish that segmentation did not quietly change the transcript. It cannot establish that the starting transcript was correct.

6. Test the file that actually comes out of your editor

You can use your usual subtitle editor, or try the existing-subtitle workspace.

For this beta workflow check:

  1. Preserve an untouched local copy of the problem file.
  2. Import one .problem.srt as an existing subtitle file.
  3. Make a deliberate timing or line-break edit.
  4. Export SRT.
  5. Open the actual returned file in your normal player or editing application.
  6. Compare its text and time ranges with the changes you intended.
  7. Save a local project copy before closing the browser.

Do not open the supplied manual reference and call that a successful export. It bypasses the very path you are trying to test.

Existing-SRT editing is distinct from asking a model to transcribe audio. If you try AI transcription separately, review its current sign-in, quote and processing information. Use only recordings you own or are authorised to process; do not upload confidential material just to test a formatting fix.

Plain SRT is also not a portable copy of every visual style shown in a preview. Verify what your selected export format actually preserves. The format guide describes the site's current options, but this exercise only checks SRT.

7. Finish with a real watch-through

For an audiovisual exercise, record yourself reading the reference text or use your own authorised recording. If the delivery does not fit the listed time ranges, adjust the captions to the actual speech.

Then watch at the intended size and playback speed. Can you follow the sentence without pausing? Are breaks sensible? Do cues survive shot changes? Are meaningful sounds or speaker changes represented as your project requires?

The strongest report is specific:

“I imported 02-too-fast.problem.srt, changed its first boundary, exported SRT, and the returned file did—or did not—preserve that change in my editor.”

That tells us more than “the subtitles work.”

Please include the fixture filename and your browser/editor, not private recordings or other people's personal details.

Top comments (0)