Translate a training video and retime the cut to fit the new voice
Translate a training video into another language: a translated voiceover, a dub, a localized version. Your agent transcribes the original, translates the script, and waits for your approval. Then it voices the new script and changes the cut so the new voice fits, holding a slide longer or opening a pause, instead of speeding the voice up.
Use invideo for this when you want the translated voice at a natural pace, with the picture retimed on an editable timeline, and a branch per language you can compare.
Quickest path
Set up your agent first with invideo for AI agents. Then give it this prompt.
Translate this training video <edit-url> into German. Transcribe it,translate the script, and show me the German script before you voiceanything. Then voice it, mute the English voice, and retime the cut sothe German fits. Never speed up the voice. Work on a branch called de.In a chat app, you paste the timeline URL or drag the video in. In a terminal, the agent uploads the file you name.
What you need
The script approval is the step that matters most.
- The video, on an invideo timeline or as a file.
- The target language.
- A person who reads that language and approves the script. The agent translates, but a native speaker catches the errors.
- A voice: a stock voice from
search_library, or a clone of the original speaker with their consent. - A glossary of product names and terms that must stay as they are.
Steps
The agent works on one branch per language.
Transcribe the original
The agent prices
audio.transcriptwithdry_runon the video's sequence URL fromadd_mediaand tells you the price. For a price of 1 credit or more it waits for your yes. Then it starts the transcript withmax_creditsset to that price, and calls again afterretry_after_sfor the words. It sees every word with its time and speaker.Translate, then wait
The agent translates line by line and keeps each line's original start and end. It writes the script to a brief with
new_brief, so you can read and edit it in invideo. It sees your approval, or applies your changes withedit.Voice the approved script
- The agent runs
find_modelswith "narration voice" and the language, picks one, and reads its inputs withget_model. A good pick iselevenlabs_text_to_speech.elevenlabs_tts_v4, with a voice whose languages include the target, fromsearch_libraryinelevenlabs_text_to_speech_voices. For the original speaker's voice, a good pick isseed_audio_1_0.ta2a, with their clips asreference_audio_1toreference_audio_3. Your agent can search for others withfind_models. - It calls
generateper line withdry_run: true, and tells you the price. - For a price of 1 credit or more it waits for your yes. Then it calls
generateper line withmax_creditsset to that price and anidempotency_key, likeline-07-de. It gets a thread URL and, when the result lands, one sequence URL per line. It reads each URL withreadand never callsgenerateagain to check.
- The agent runs
Branch and mute the original voice
The agent creates a branch with
timeline_history, and mutes the original voice there withset_audio_muted. It sees a newstate_token.Place each line and retime the cut
The agent places each new line at its original start with
place_media. Where a line runs long, it opens time on every track withedit_time_rangemodeinsert, or holds a slide longer withtrim_clipon its tail. Where a line runs short, it removes the extra time withedit_time_rangemodeclose_gap. It never usesretimeon the voice. It sees each line end before the next starts.Translate the words on screen
The agent changes text clips with
set_text, and adds captions withadd_captionsfrom a transcript of the new voice. It sees the translated text incaptureframes.Check, then export
The agent calls
captureat each changed spot andcheck_timeline, thenexporton the branch. It sees an export card with statuscompleted.
The terminal version:
invideo media audio.transcript <sequence-url> --dry-runinvideo media audio.transcript <sequence-url> --max-credits <price>invideo library search <project-url> \ --library elevenlabs_text_to_speech_voices --query "German narrator"invideo gen models <project-url> --query "German narration voice"invideo gen model <project-url> \ --model elevenlabs_text_to_speech.elevenlabs_tts_v4invideo gen run <page-url> \ --model elevenlabs_text_to_speech.elevenlabs_tts_v4 --dry-run \ -i prompt=@line-07-de.txt -i voice_id=<voice-id>invideo gen run <page-url> \ --model elevenlabs_text_to_speech.elevenlabs_tts_v4 \ --max-credits <price> --idempotency-key line-07-de \ -i prompt=@line-07-de.txt -i voice_id=<voice-id>invideo status <thread-url> --waitinvideo notebook show <thread-url>invideo edit show <edit-url> --jsoninvideo branch new <edit-url> --name de --token <state_token>invideo edit show <branch-url> --jsoninvideo edit change <branch-url> --timeline T1 --token <state_token> \ --operations @retime-de.jsoninvideo edit capture <branch-url> --at 10,42,75 --out ./framesinvideo edit check <branch-url>invideo edit export <branch-url> --format video --quality 1080 --jsoninvideo status <card-url> --waitinvideo notebook show <card-url> --out ./out/deWhere each value comes from:
<sequence-url>is the video'surlfrominvideo asset upload, a…/notebook/seq-N.MURL.<price>is each dry run's.estimated_credits.<project-url>is the video's project.<page-url>is a notebook page of the project, listed byinvideo notebook show <project-url>.<voice-id>comes from thelibrary searchline. It works only withelevenlabs_text_to_speech.elevenlabs_tts_v4.<thread-url>is theurlthe paidgen runreturns.notebook showon it lists the take's sequence URL.<edit-url>is the video's timeline URL, frominvideo edit newor the editor.<state_token>comes frominvideo edit show <edit-url>forbranch new.<branch-url>is thebranch_urlthatinvideo branch newreturns. After that,<state_token>comes frominvideo edit show <branch-url>, read again before each change, because the main token is stale on the branch.<card-url>is.sequences[0]of the export answer.invideo statuswaits but saves nothing.invideo notebook showsaves the video as./out/de/export.mp4, and the agent renames it.
The file behind @retime-de.json is the bare list of ops that --operations takes. Here one line runs long, so the agent opens the extra frames on every track and places the take. c4 is the original voice clip's id from invideo edit show. The asset is the take's sequence URL from the thread.
[ { "op": "set_audio_muted", "target": "c4", "muted": true }, { "op": "edit_time_range", "timeline": "T1", "start_f": 1260, "end_f": 1290, "mode": "insert" }, { "op": "place_media", "asset": "<line-07-sequence-url>", "track": "A1", "at_f": 1170, "source_start_seconds": 0, "source_end_seconds": 4, "mode": "overwrite", "linked_audio": false }]No one-shot dub
invideo has no model that translates a whole video in one call. For a quick draft with no script step, use a dubbing service, named at the end of this page. Use the steps above when the wording matters.
Cost and time
Edits and exports are free. Generation and transcripts cost credits. Paid stock costs a small credit charge, or one of your workspace's iStock licenses. Your agent runs a dry run first and tells you the price before it spends anything.
- Costs credits: the transcript, each voice take, and stem separation if needed.
- Free: the branch, every edit,
captureandexport.
The voice and the edit take under an hour per language. Your review of the script takes the longest. See Credits for prices.
If something goes wrong
Most problems are lines that do not fit.
| Symptom | Fix |
|---|---|
get_model or generate refuses the model as not found | Models retire. Run find_models with the job in words, use the best match, and tell the person which model you used. |
audio.transcript refused with code: "not_found", or CLI exit 2 | The call named a media bin asset. Pass the video's sequence URL from add_media or invideo asset upload. |
CLI exit 3 on the first change after invideo branch new | The main token is stale on the branch. Run invideo edit show <branch-url> and use its state_token. |
invideo status --wait ends and the folder is empty | status does not download. Run invideo notebook show <card-url> --out <dir>. |
| A line overlaps the next | Open time with edit_time_range mode insert at the end of the line, or hold the slide longer. |
| The picture drifts out of sync | The time changed on one track only. Use edit_time_range, which moves every unlocked track. |
| The music cuts out with the old voice | The voice and music share one clip. Split stems with media audio.separate on the video's sequence URL, after a dry run, and keep the music stem. |
| Brand names are translated | Keep them in the script as they must be said, and list them in the brief. |
| CLI exit 3 | The edit changed since your read. Run invideo edit show and rebuild. |
| Avoid: speed up the voice to fit | Instead: retime the cut. Fast speech is hard to follow in training. |
| Avoid: voice before approval | Instead: show the script and wait for a yes. |
Prompts to try
Each prompt is a real variation of this job.
Make Spanish (Mexico) and Portuguese (Brazil) versions of this video, onebranch each. Use the glossary in our brief. Show me both scripts first.Give me a quick French draft of the first few lines only, so I can seeif the length works before we do the rest.Translate only the on-screen text and captions into Japanese. Keep theEnglish voice.When to use something else
invideo does not judge translation quality. A native speaker or a translation vendor reviews the script. For a one-shot dub with no script step, use ElevenLabs Dubbing or HeyGen video translation, then bring the file into invideo for the cut and captions. For a speaker on camera, the new voice does not match their lips. Re-sync the mouth with a lip sync model, as on Dub existing footage.