Adds a text item. The style is stored exactly as given, including keys equal to the default. x and y are the centre of the item in pixels; without them the item is centred.
Arguments#
| Argument | Type | Required | Description |
|---|---|---|---|
duration | string | yes | A length of at least 1 frame. |
id | string | no | |
start | string | yes | a time with a unit: "12.5s", "375f" or "00:00:12.500" |
style | object | no | A partial TextStyle. |
text | string | yes | The text; line breaks are allowed. |
track_id | string | yes | A visual track. |
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": "text.add",
"args": {
"duration": "2s",
"id": "itm_s6t7v8w9x0",
"start": "0s",
"style": {
"size": 96
},
"text": "Hello",
"track_id": "trk_f6g7h8j9k0"
}
}Errors#
E_VALIDATION, E_INVALID_TIME, E_NOT_FOUND, E_TYPE_MISMATCH, E_ID_EXISTS, E_LIMIT, E_FONT_UNKNOWN, E_OVERLAP
Scope and phase#
Scope edit, phase prototype. Run vukem-video command:help text.add for the same description from the binary.