All guides

Why auto-generated captions repeat every line

By · Updated

In short: automatic captions are written for a screen where lines scroll upward. Each cue describes the whole screen — the line that is scrolling away plus the new one — so once the timing is stripped, every line appears two or three times in a row. The duplicates can be removed by comparing each line with its neighbor, as long as you know what that rule can and cannot tell apart.

Three ways captions appear on screen

Broadcast captioning has long distinguished three display styles, and the names are useful for understanding subtitle files:

  • Pop-on. A complete caption appears at once and is replaced by the next one. This is how film and series subtitles work, and how most captions prepared by a person are written.
  • Roll-up. Text appears on the bottom line; when a new line arrives, the previous one moves up and the oldest disappears. Live television uses it because the captioner never knows what comes next.
  • Paint-on. Text appears word by word or letter by letter in place.

YouTube’s automatic captions behave like roll-up captions with paint-on words: each new line is revealed word by word, then pushed up when the next line starts.

How scrolling becomes duplicate lines

In the YouTube-style export shown below, successive cues repeat text that remains visible on screen. Flattening those cues creates duplicates. This is an export pattern, not a limitation of every subtitle format: WebVTT also defines scrolling regions with scroll:up.

00:00:00.000 --> 00:00:02.330
so today we're going to talk

00:00:02.330 --> 00:00:02.340
so today we're going to talk

00:00:02.340 --> 00:00:05.150
so today we're going to talk
about subtitles and how they work

00:00:05.150 --> 00:00:05.160
about subtitles and how they work

00:00:05.160 --> 00:00:07.990
about subtitles and how they work
[Music]

The very short cues (ten milliseconds) are the moment the line moves up. For a viewer this is invisible. For a reader, once the timing lines are gone, it turns into this:

so today we're going to talk
so today we're going to talk
so today we're going to talk
about subtitles and how they work
about subtitles and how they work
about subtitles and how they work

The amount of repetition depends on the export. Count the words before and after cleanup on your own file rather than assuming a fixed reduction.

Why find-and-replace is not enough

If every duplicate were an exact copy, deleting repeated lines would solve it. In real files they are not always identical:

  • While a line is being painted on, it appears in partial versions: “I think”, then “I think we should”, then “I think we should start”.
  • Word-level timing codes, such as <00:00:00.320>, make two copies of the same line look different until they are removed.
  • Spacing and tags vary between the copy that is being painted and the copy that is scrolling away.

So the comparison has to happen after the timing codes and tags are removed, and it has to handle lines that grow, not just lines that repeat.

How delsub removes the repeats

With Roll-up repeats switched on, delsub cleans each line first and then walks through them in order, comparing every line only with the one kept just before it:

  1. If the line is identical to the previous one, it is dropped.
  2. If the line starts with the previous one (“I think” followed by “I think we should”), the longer line replaces the shorter one.
  3. If the previous line starts with this one, this one is dropped, because it is a fragment of text already kept.

Applied to the example above, six lines become two, and with paragraph rebuilding on they read as one sentence: so today we're going to talk about subtitles and how they work.

What the rule cannot tell apart

Comparing neighboring lines is effective, but it cannot know whether a repetition was on screen or in the speech. Three cases are worth knowing:

  • Real repetitions are removed too. A chorus line sung twice in a row, or a speaker who says “No.” and then “No.” again, collapses into one line.
  • A sentence that a speaker extends loses its first version. “I don't know” followed by “I don't know why he left” keeps only the second line, even if the speaker really said both.
  • Partial overlaps are not detected. If a source repeats only the end of the previous line (“talk about” followed by “about subtitles”), neither line starts with the other, and both stay.

That is why the rule has its own switch. For captions written by a person, which are almost always pop-on and have no scrolling repeats, turning it off is safe and keeps every line exactly as written.

A quick way to check

delsub shows a live word count under the output. Toggle Roll-up repeats and watch it: a drop shows that the rule removed or merged lines, but it does not prove that every removal was appropriate. Compare a repeated passage with the original; leave the switch off when intentional repetition must be preserved.

A checked example of what can be lost

Download this synthetic SRT. It contains two separate “No.” cues, a short phrase followed by its extension, and an overlap that the rule does not detect:

No.
No.
I don't know
I don't know why he left.
talk about
about subtitles

With all seven switches on, the exact text output is:

No.

I don't know why he left.

talk about about subtitles

Turn only Roll-up repeats off and the output is:

No.

No.

I don't know I don't know why he left.

talk about about subtitles

These results were reproduced with delsub’s text-processing functions on 21 October 2026. Download the exact outputs with roll-up on and roll-up off; each has a final newline. The duplicated “about” remains in both. A lower word count is useful for spotting changes, not for certifying an accurate transcript.

Sources and scope

Primary documentation checked on 21 October 2026. The examples above test delsub’s own behavior; they do not certify every subtitle file or third-party interface.

  • W3C WebVTT specification — cue text, inline timestamps and scrolling regions; not a specification of every YouTube export.

Try it with a caption file of your own in delsub: everything is processed in your browser, and each cleaning rule can be switched on or off independently.