Skip to main content
When you already have subtitles for a video, send them with the project. Rask then dubs your text instead of what speech recognition would hear. The subtitles are SRT, sent inline in the request. Sending them at creation needs the plan feature subtitle_import, and replacing the transcript later needs subtitle_reimport.

What you can send

subtitles on createProject takes a source file, a target file, or both: The rules for a file:
  • Each file is {"format": "srt", "content": "..."}, where content is the whole SRT file as one JSON string, at most 2 MiB and 5000 cues.
  • source_language is required with source.
  • With both files, the cues must match: the same number, with the same times and, where both files label a cue, the same speaker.
  • A cue may start with a speaker label such as [SPEAKER_00]:. Label every cue or none.
  • Every cue starts before it ends, and ends within the media.
A file that breaks a rule answers 422 subtitles_invalid, and its errors say which rule and where. A content longer than 2,097,152 characters (2 MiB) answers 422 validation_failed instead.

1. Estimate

The price does not depend on the subtitles. A project with your own text costs what any project costs: the project itself, and the auto-dub, which is priced on the length of the media. So the estimate can leave the subtitles out, which also keeps it small: an estimate takes 1 MiB at most, while createProject takes 5 MiB. Without them, the estimate does not check the files or the plan feature subtitle_import: only createProject does. When the request with them fits in 1 MiB, send them to the estimate as well to check them first.
Keep total_minutes: it is the price cap you send next.

2. Create the project

The answer is a project_processing job with the new project_id, as in the Quickstart. The auto-dub follows it as a dub job of its own. Your own text is paid text like any other. Until the dub of the project is charged, reading the transcript back answers 409 dub_payment_required.

3. Replace the transcript later

importTranscript puts new subtitles into a project that already exists, for example after a translator has edited the file. It needs the scope transcripts:write, and it is free.
The answer is a project_processing job. Wait for it as for any job. What to know before you send it:
  • The whole transcript is replaced. Every segment gets a new id, and a listSegments cursor from before answers 409 transcript_replaced.
  • The side you leave out is made again. With source only, the translation is made again by machine. With target only, the source text is recognized again inside your cue times. Send both files to keep both texts as you wrote them.
  • The old transcript is not lost. A version is saved first, and if the job fails the old transcript comes back. See listTranscriptVersions.
  • It does not dub. The import ends when the text is ready.
  • The first dub must have been charged. Before that, on a project created through this API, the import answers 409 dub_payment_required, like every other operation on the text.
  • The project must be at rest. While it is processing, dubbing, translating or lip-syncing, the import answers 409 project_not_ready, dub_in_progress or transcript_busy, and while another import runs, subtitle_import_in_progress.
  • It counts against the hourly translation budget, by its number of cues (translation-hour in Rate limits). Over the budget it answers 429 rate_limited, and a file with more cues than the whole budget answers 422 translation_batch_too_large.

4. Bring the dub up to date

After the import, the dub no longer matches the text:
  • every segment reads dub_state: outdated, and counts.needs_redub of getTranscript counts them;
  • the dubbed outputs of listProjectOutputs read outdated: true.
Dub again, after an estimate. Every line is new, so the whole project is dubbed, and the redub is charged for the speech in it, in whole minutes.
A new dub also leaves behind what was built on the old one. The lip-synced video is removed (available: false, unavailable_reason: not_produced), and a video with burned-in subtitles or translated on-screen text reads outdated: true. Order those again, each at its own price: see Lip-sync, On-screen text and Downloads.