OpenCaptions

v1.6.0
io.github.leogaudin/opencaptions Checked 4 days ago Published 2 days ago

Animated word-by-word captions for your videos, on your computer or your own OpenCaptions server

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

caption_video

Adds animated word-by-word captions to a video: transcribes the speech, styles it with a look, and saves the captioned video next to the source. Returns its path and a project id for follow-ups (get_transcript, fix_words, set_style, save_video). If it takes longer than the call allows, it returns a ticket: pass it to check_progress.

check_progress

Carries on with a caption_video or save_video that returned a ticket.

ParameterTypeDescription
ticket *objectThe ticket, as it was returned

list_looks

The built-in caption looks, each with its animation, font and colours.

describe_style

Every style setting with its type, range, default and meaning, for caption_video's and set_style's `style`.

get_transcript

A project's captions as they show on the video, and every word with its index, to check names and spelling before fix_words.

ParameterTypeDescription
project_id *stringThe project id a caption_video call returned (on this computer, a file's path)

fix_words

Sets words by the index get_transcript gave them, keeping their timing; empty text removes a word, and count joins that many words into one spanning them all (two words heard for one). Then save_video writes the video again.

ParameterTypeDescription
fixes *array
project_id *stringThe project id a caption_video call returned (on this computer, a file's path)

set_style

Changes a project's style: a look, settings over it, or settings alone over the style it has. Then save_video writes the video again.

ParameterTypeDescription
project_id *stringThe project id a caption_video call returned (on this computer, a file's path)
lookstringA built-in look (list_looks)
styleobjectStyle settings (describe_style)

save_video

Saves a project's captioned video again, after fix_words or set_style, or in another format, size or as captions only.

ParameterTypeDescription
project_id *stringThe project id a caption_video call returned (on this computer, a file's path)
captions_onlybooleanThe captions alone over solid green, with no sound, to key out in Remotion or a video editor
formatstringmp4 (the default), mp4-hevc, webm or mov (ProRes)
frame_ratestringFrames per second, or the source's
outputstringWhere to write the file. Default: next to the source, named <name>.captioned
resolutionstringThe short side in pixels, or the source's

export_subtitles

Writes a project's captions as SRT or VTT subtitles, or its transcript as JSON.

ParameterTypeDescription
format *string
project_id *stringThe project id a caption_video call returned (on this computer, a file's path)
outputstringWhere to write it; next to the video by default