OpenCaptions
v1.6.0Animated 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.
| Parameter | Type | Description |
|---|---|---|
ticket * | object | The 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.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
fixes * | array | |
project_id * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | The project id a caption_video call returned (on this computer, a file's path) |
look | string | A built-in look (list_looks) |
style | object | Style 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.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | The project id a caption_video call returned (on this computer, a file's path) |
captions_only | boolean | The captions alone over solid green, with no sound, to key out in Remotion or a video editor |
format | string | mp4 (the default), mp4-hevc, webm or mov (ProRes) |
frame_rate | string | Frames per second, or the source's |
output | string | Where to write the file. Default: next to the source, named <name>.captioned |
resolution | string | The 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.
| Parameter | Type | Description |
|---|---|---|
format * | string | |
project_id * | string | The project id a caption_video call returned (on this computer, a file's path) |
output | string | Where to write it; next to the video by default |