Skip to content

Creative tools

Text and captions

Put text on screen, create word-timed captions and style them once for a whole track.

Last updated:

You will learn#

The idea#

A text item shows a string for a duration. A caption is word-timed text on a caption track: every word has its own start and length, so the style can highlight the word being spoken. The style belongs to the track, so every caption on it looks the same.

Captions usually come from speech: see Transcription to create them from a clip. The lint rules check that text stays inside the safe areaThe part of the screen where text will not be cut off or covered. of the format (Safe area).

Quick start#

Put a title on screen for three seconds:

JSON
{ "op": "text.add", "args": {
  "track_id": "trk_a1b2c3d4e5", "start": "0s", "duration": "3s", "text": "Launch day"
} }

Change the text later with text.set. Give a text item an entrance and an exit with an animation preset.

Correct a caption#

ToOperation
change one word, or remove it (empty text)caption.edit_word
replace all the words of a captioncaption.set_words
cut a caption in two before a wordcaption.split
join two captions of one trackcaption.merge
choose where a line breakscaption.set_breaks
move the words to follow a clip you retimedcaption.retime_from_clip

caption.split takes the index of the first word of the right part (before_word, at least 1). caption.merge takes exactly two captions of the same track. In the editor, the Caption words table of the inspector lists every word with its start, duration and line break, and has a Split button before each word.

Style a caption track#

track.set_caption_style sets the style of a caption track. A caption item reads it from its track, so a change reaches every caption at once. In the editor the inspector of a caption track has the style fields and the buttons Replace the whole style and Clear the style.

Common mistakes#

  • Putting text on an audio track: E_TYPE_MISMATCH.
  • Text that leaves the safe area: a lint warning, not an error. Run lint before you export.
  • Styling one caption when you meant the track: the style is on the track, not on the caption.

Next steps#