Film kit command
caption.add
Add Caption at Playhead
Adds a caption on a caption track at the playhead (or `time` ticks / `seconds`), `durationSeconds` long (3 by default) with `text`, its In and Out each on the frame that shows their time; creates track C1 if the sequence has none. `words` [{text, start, end} in sequence seconds] makes a karaoke caption spanning the words: each word gets a WebVTT timestamp, Chinese/Japanese/Korean words join without spaces, and burned-in captions draw the word being sung in the track's highlight colour and scale (a pause between words highlights nothing). Inline <b>, <i>, <u> are drawn. Answers the new caption.
- Kit
- Film 0.1.0 (.kfilm)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
durationSeconds | number | no | |
frame | integer | no | the time, as a frame of the sequence (one spelling of it) |
seconds | number | no | |
text | string | no | |
time | integer | no | ticks (254016000000 per second) |
timecode | string | no | the time, as a timecode (one spelling of it) |
track | string | integer | no | id|"C1"? |
words | object[] | no | karaoke; the caption spans them unless seconds/durationSeconds are given |
Call through film_run
film_run {
"path": "<file>.kfilm",
"steps": [{ "command": "caption.add" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: durationSeconds, frame, seconds, text, time, timecode, track, words. film_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
{
"additionalProperties": false,
"properties": {
"durationSeconds": {
"default": 3,
"type": "number"
},
"frame": {
"description": "the time, as a frame of the sequence (one spelling of it)",
"type": "integer"
},
"seconds": {
"type": "number"
},
"text": {
"type": "string"
},
"time": {
"description": "ticks (254016000000 per second)",
"type": "integer"
},
"timecode": {
"description": "the time, as a timecode (one spelling of it)",
"type": "string"
},
"track": {
"description": "id|\"C1\"?",
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"words": {
"description": "karaoke; the caption spans them unless seconds/durationSeconds are given",
"items": {
"additionalProperties": true,
"properties": {
"end": {
"description": "seconds",
"type": "number"
},
"start": {
"description": "seconds",
"type": "number"
},
"text": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (film_commands through @kition/[email protected], built from KitionAI/kition-film@375db59). As data: commands.jsonl.