# A caption across a removed gap: an interval map

Correct film duration does not confirm caption timing. Our own trial maps five intervals and checks colored markers in every frame.

L00P.AI · 1.0 · 2026-11-21

https://www.l00p.ai/en/resources/series/napis-przez-wycieta-przerwe-mapa-przedzialow/

## 01 / After a cut, captions need a new map

A film can have the correct duration while a caption appears beside the wrong excerpt. Removing a gap from a recording changes the positions of later captions. An interval crossing the cut also needs a decision about which parts remain. For a leader commissioning an edit, this is a separate acceptance check: verify the graphics in the output as well as the frame count.

We develop the [source-to-output map](/en/resources/series/transkrypcja-nie-jest-lista-ciec/). Our own trial checks interval arithmetic and the display timing of colored rectangles. These rectangles stand in for timed markers; they contain no text. The result does not yet assess actual captions, their readability or the meaning of speech after a cut.

## 02 / Intersect first, then shift

All boundaries are in frames, counted from zero. The notation [a,b) includes the start and excludes the end. From our own 40-frame source at a constant 10 frames per second, we retained [0,10) and [20,40). The output has 10 + 20 = 30 frames, or three seconds; the removed gap [10,20) lasts one second.

For a caption interval [c,d) and a retained range [a,b), calculate lo = max(a,c) and hi = min(b,d). If lo is less than hi, the part [lo,hi) remains. If that range starts at output frame o, record the part as [o+lo-a,o+hi-a). Otherwise, transfer nothing from this range. This is the explicit rule for this constant-frame-rate demonstration, not a universal conversion for every video file.

Interval A [5,25) intersects both retained ranges. Source [5,10) maps to output [5,10), while source [20,25) maps to output [10,15). In output seconds these are 0.5–1.0 and 1.0–1.5 respectively. The parts touch, so marker A is visible continuously on frames 5–14. We preserve two map entries so their different origins remain traceable.

![A: [5,10) and [10,15); B/D removed; C: [20,25); E: [0,5). Markers without text.](https://www.l00p.ai/wydawnictwo/napis-przez-wycieta-przerwe-mapa-przedzialow/cue-map-en-v1.svg)

```text
10 fps; boundaries in frames; exclusive end
keep: [0,10) -> [0,10); [20,40) -> [10,30)
A: [5,10)  -> [5,10)
A: [20,25) -> [10,15)
B: [12,18) -> absent
C: [30,35) -> [20,25)
D: [10,20) -> absent
E: [0,5)   -> [0,5)
```

## 03 / What disappears with the gap

Interval B [12,18) lies inside the removed range, while D [10,20) covers it exactly. Both disappear. Exclusive boundaries matter: frame 10 no longer belongs to the first retained range, while frame 20 starts the second. C [30,35) shifts to [20,25), and E [0,5) stays in place.

This is a technical decision about marker timing. Copying an entire sentence onto both A parts could display words that were removed. The trial contains no words and does not decide how to split them. An editor should return to the speech, check the meaning of the surviving parts, determine the new text and then accept its timing and readability.

## 04 / What we actually measured

On 21 November 2026 we ran one trial under a protocol saved beforehand: our own 40 RGB24 frames, 64 × 48 pixels, without sound. Every frame had a gray background whose value equaled its source frame number. Five fictional intervals A–E received distinct colored rectangle positions. We used no third-party footage, voice, music or glyph renderer.

FFmpeg selected the ranges with [trim](https://ffmpeg.org/ffmpeg-filters.html#trim), reset each excerpt's presentation timestamps with [setpts=PTS-STARTPTS](https://ffmpeg.org/ffmpeg-filters.html#setpts_002c-asetpts) and joined them with [concat](https://ffmpeg.org/ffmpeg-filters.html#concat). We applied [drawbox](https://ffmpeg.org/ffmpeg-filters.html#drawbox) overlays on the output timeline using gte(n,start)*lt(n,end). The [documentation](https://ffmpeg.org/ffmpeg-filters.html#Timeline-editing) describes n as the input frame number of that filter, starting at zero. The filter's position in the chain is therefore part of the method: here it counts frames after concatenation.

Each of the three raw outputs — without markers, mapped and control — had 30 frames and 30 × 64 × 48 × 3 = 276,480 bytes. Every byte of the correctly mapped image matched a separately constructed reference. We also checked all interval boundaries and each marker's activity; the record contains 11 passing checks. These are checks within one trial, not 11 independent experiments. A later inspection of the saved files confirmed hashes and pixel agreement without repeating the original experiment.

## 05 / The faulty version also lasted three seconds

In the negative control we left the original caption intervals on the shortened film's timeline. The output still contained 30 frames. Its image nevertheless differed from the correct reference on exactly frames 10–24 inclusive: 15 frames, or half the output. Correct duration alone missed the graphics error.

Acceptance should compare each element's expected presence with the final image, including the first and last included frame and frames beside the boundaries. Here we compared every pixel of all 30 frames with zero byte tolerance in RGB24. We do not automatically apply that tolerance to lossy compressed exports or variable frame rates.

## 06 / Timing, text and broadcast approval

For your own commission, retain the original, the kept ranges, the text version, every interval's map and the final export check. Recalculate the map and repeat the relevant acceptance after changing the edit. The person responsible for captions should also check sentence splitting, reading speed, line breaks and the image on the target screen. Rectangle agreement cannot replace those checks.

The [WebVTT working specification dated 20 May 2026](https://www.w3.org/TR/2026/CRD-webvtt1-20260520/) describes caption interval start and end offsets. We reference its syntax scope and document status; we did not test a WebVTT parser or player. The online FFmpeg manual read on 21 November 2026 is a separate source from the installed version used in the trial: 2025-11-12-git-6cdd2cbe32. We retained its help, commands and results. Caption readability, audio, speech synchronization, production recordings and UTC clock agreement remain outside the evidence.

Codex prepared the PL/EN text, arithmetic, original SVG diagram and ASCII equivalent, and checked the saved data. The same agent performed the author review; there was no independent second-model review. A changed source, ranges or tool, or inconsistent maps, pixels or hashes trigger a correction and appropriate renewed acceptance. To check your own edit, start with one caption crossing a cut.
