Adds a caption. Give either words (times relative to the caption, as lengths) or text with a duration: the text is split on whitespace and the words share the duration in proportion to their character counts. x and y are used when the caption style position of the track is custom.
Arguments#
| Argument | Type | Required | Description |
|---|---|---|---|
duration | string | no | A length; with text only. |
id | string | no | |
linked_item | string | no | The clip whose speech this transcribes; it need not exist. |
start | string | yes | a time with a unit: "12.5s", "375f" or "00:00:12.500" |
text | string | no | Text to split on whitespace; needs duration. |
track_id | string | yes | A visual track. |
words | array of object | no | Words with times relative to the caption, as lengths. |
x | number | no | |
y | number | no |
Example#
As one operation of an edit batch (the edit tool of MCP, vukem-video edit --ops, or POST /api/v1/projects/{id}/edit):
{
"op": "caption.add",
"args": {
"duration": "48f",
"id": "itm_s6t7v8w9x0",
"linked_item": "itm_m1n2p3q4r5",
"start": "12f",
"text": "Meet the new editor.",
"track_id": "trk_a1b2c3d4e5"
}
}Errors#
E_VALIDATION, E_INVALID_TIME, E_NOT_FOUND, E_TYPE_MISMATCH, E_INVALID_STATE, E_ID_EXISTS, E_LIMIT, E_OVERLAP
Scope and phase#
Scope edit, phase prototype. Run vukem-video command:help caption.add for the same description from the binary.