Reversible Caption Workflows Reduce Editing Debt
Caption pipelines often become one-way transformations. Once text and timing are flattened into final exports, every content tweak becomes expensive.
Step 1: Preserve source timeline as canonical state
type CaptionCue = {
id: string;
startMs: number;
endMs: number;
text: string;
};
type CaptionTimeline = {
videoId: string;
cues: CaptionCue[];
};
Step 2: Export format adapters, not destructive conversions
function toSrt(cues: CaptionCue[]): string {
return cues
.map((c, i) => `${i + 1}\n${c.startMs} --> ${c.endMs}\n${c.text}\n`)
.join('\n');
}
Step 3: Keep diff-friendly edit history
{
"cue_id": "c17",
"before": "Original sentence",
"after": "Improved sentence",
"edited_at": "2026-03-11T07:00:00Z"
}
Pitfalls
- Editing only rendered subtitle files, not source timeline.
- No cue-level IDs for targeted updates.
- Timing recalculation mixed with text rewrite steps.
Verification
- Timeline can regenerate SRT/VTT outputs consistently.
- One cue edit does not rewrite unrelated cues.
- Round-trip import/export retains timing precision.