video-subtitles
Subtitles and transcripts
Which path
- VideoDB connector tools present (names such as
generate_transcript,add_subtitles,translate_transcript,upload_media): use them. This is the path in Claude chat on web, desktop and mobile, and in Cowork. Do not install anything and do not ask for an API key. - No VideoDB tools, but you have a shell (Claude Code, Cowork, any agent that can run Python): ask for the VideoDB API key in one friendly line (free at https://console.videodb.io, $20 of credits, no card). When the user gives it, in chat or any other way, save it yourself to the project's
.envasVIDEO_DB_API_KEY, never print it, and continue with the Python SDK path at the end of this file. In Claude Code,/mcpthen authorizing videodb also works. - No VideoDB tools and no shell: you are in Claude chat. Reply with only this, adapted to the request: "VideoDB isn't connected yet. Open Settings → Connectors, find VideoDB, click Connect and log in (free, no card). Then send this request again and I'll take it from there." Do not mention API keys,
.env, shells, Claude Code or/mcphere; none of them apply in chat, and a key pasted into chat cannot be used because nothing runs code there.
Talking to the user: never write "index", "indexed" or "indexing" in a reply. Say "searchable" ("it is now searchable by what was said and what is shown"), and "transcribe" rather than naming a job. One line of status at a time, then the result.
Long jobs return status: processing. The reply carries an output_url and names the tool to poll (poll_with, or retry_with on older servers). Call that tool with the output_url until it is done; several processing replies in a row are normal (a 10-minute YouTube upload takes about five), and a done reply with an empty result means poll once more. Never re-run the write; that starts a second job.
With the connector tools
Get the video. First search_videos_by_title(query); reuse the m- id if the video is already in the account. Otherwise, for a YouTube link or public URL, upload_media(url) and poll until done; note the m- id. Local files cannot come through the connector; the user uploads at https://console.videodb.io and shares the m- id.
Transcript. generate_transcript(media_id) (add language_code if the speech is not English), poll until done, then get_transcript(media_id, timestamped=true, segmenter="sentence") for sentence timestamps, or timestamped=false for plain text. The default segmenter is one segment per word and timestamped output is capped at 2000 segments, so pass segmenter="sentence" or start and end for long media. The transcript job result also carries text and a word list, but the list is truncated; read the transcript with get_transcript.
Subtitles burned into the video.