add_caption_track
Build a caption track from pre-timed lines (e.g. derived from transcribe_clip's word timings). mode "line-sync" (default) creates one text layer per line, each shown only during its [startFrame, endFrame) window via hold-eased opacity keyframes — the active-line karaoke read; mode "static" makes a single layer with all lines joined. style picks a preset look. Lines default to a lower-third band. The caption layers are always wrapped in a "captions" group so they don't clutter the layers list. Returns the created text element ids plus groupElementId (the captions group).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Caption band centre x. Default canvas centre. | |
| y | No | Caption band centre y. Default lower third (~80% of height). | |
| mode | No | "line-sync" (default): one timed layer per line. "static": one layer with all lines. | |
| lines | Yes | Caption lines in order. Each: { text, startFrame, endFrame } — frames are 0-indexed at 30fps. | |
| style | No | Caption look preset. Default "classic". | |
| width | No | Band width. Default ~86% of canvas width. | |
| height | No | Band height. Default ~16% of canvas height. | |
| projectId | Yes | Opaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates. | |
| clip_element_id | No | Optional "video.<id>" to WELD the caption lines to (line-sync mode). When set, each line's startFrame/endFrame are treated as its window in the clip's OWN source timeline and the on-timeline position is derived live from the clip's trim — so trimming or sliding the clip retimes/clips the captions, exactly like the clip's welded audio. Omit for fixed project-frame captions. |