Skip to content

How do I rebase existing captions when I extract only one short section of a long performance?

Intersect every original cue with the approved source excerpt, discard cues outside it, and subtract the excerpt's source start from retained times. Preserve a record of cues clipped at either boundary for editorial review. If playback speed also changes, apply the documented time mapping separately. A timestamp transformation cannot decide whether a clipped caption still represents a complete, readable spoken phrase.

CAPTION DELIVERY: FILES, TRACKS AND BROWSER BEHAVIORAISwapLab team · Editorial methodPublished 3 min read
See the recorded exampleExplore 67 Image SkillsIndependent finishing · Check the actual file
Editorial worksheet excerpt: 10–13 s; 14–16 s; 17–19 s; 18–20 s. See the complete table and sources below.
Editorial worksheet excerpt: 10–13 s; 14–16 s; 17–19 s; 18–20 s. See the complete table and sources below.

Caption excerpt mapping

A long performance's captions use its original timeline. A six-second excerpt beginning twelve seconds into that performance needs a new local timeline, not the untouched source timestamps. The task creates an interval-mapping worksheet and a small transformation test rather than a full subtitle parser. It complements the general advice to recheck captions after editing with explicit handling of partial cues, empty intersections and speed changes. The same source identity must underlie both the picture cut and the caption input.

Build the evidence

  1. 01

    Write the mapping before touching cue text

    Specify the source start and exclusive end, the output time origin and any speed factor. Keep integer milliseconds when the source cues use millisecond precision. A simple excerpt with unchanged speed has output time equal to source time minus excerpt start. If the picture was reinterpreted or retimed, obtain the actual timeline map; do not infer it from a nominal frame-rate field or the desired video duration.

  2. 02

    Intersect intervals and preserve boundary evidence

    For each cue, keep the greater of cue start and excerpt start, and the lesser of cue end and excerpt end. Discard the cue when the retained end is not later than the retained start. Rebase remaining intervals to output zero. The Python example operates on already parsed cue records, not raw SRT or VTT text, and deliberately leaves text unchanged. Use a proper format parser and serializer for complete files with identifiers, settings, comments or styles.

  3. 03

    Review clipped phrases against the actual export

    Flag every cue whose interval was shortened. Listen at the excerpt opening and ending to decide whether words should be revised, combined or removed; never leave text claiming speech that the saved picture/audio no longer contains. Check reading time and overlap after any speed mapping. Export the caption file through an appropriate serializer, reopen it with the final video, and compare early, middle and final cues before sharing.

A bounded example

Executable synthetic mapping: with source excerpt [12000,18000) milliseconds, a cue [10000,13000) becomes [0,1000), [14000,16000) becomes [2000,4000), and [17000,19000) becomes [5000,6000). A cue starting at 18000 is discarded. These interval results are deterministic, but the first and last texts still need human review for clipped speech. This example does not parse a full subtitle file or establish a caption quality score.

Local diagnostic commands

The supplied integer-millisecond interval algorithm and all four synthetic cue cases were executed locally, with assertions passing. This does not test a full subtitle parser, serializer, browser playback or paid generation.

python
# Already parsed cue records in integer milliseconds, not a VTT parser.
start, end = 12000, 18000
cues = [(10000,13000,"opening"), (14000,16000,"middle"),
        (17000,19000,"ending"), (18000,20000,"outside")]
out = []
for a, b, text in cues:
    left, right = max(a, start), min(b, end)
    if right > left:
        out.append((left-start, right-start, text, (left != a or right != b)))
assert [(a,b) for a,b,_,_ in out] == [(0,1000),(2000,4000),(5000,6000)]
print(out)  # Last boolean flags a boundary-clipped cue for human review.

Caption excerpt mapping

Source cueOutput intervalEditorial check
10–13 s0–1 sOpening text may be incomplete
14–16 s2–4 sFull cue retained
17–19 s5–6 sEnding text may be incomplete
18–20 sDiscardedOutside exclusive source end

Acceptance evidence

  • Picture and caption source versions use the same approved source coordinate system.
  • Start inclusion and end exclusion are explicit and empty intersections are discarded.
  • Boundary-clipped cue text is reviewed rather than automatically declared correct.
  • The serialized output is checked against the actual final media, including speed changes.

Stop condition

Stop when a retimed sequence lacks a trustworthy source-to-output map, or an excerpt begins halfway through a required phrase that cannot be captioned honestly. Resolve the edit first. Repeatedly nudging individual cues until they appear plausible can hide a systematic mapping error and make the next revision harder to reproduce.

Sources

Review the result in context.

Compare the recorded example and its documented limitations.

See the recorded example