Dub existing footage
Dub existing footage: translate it, re-voice it, or replace a speaker's voice in a video you already shot. Your agent makes new speech timed to the picture, keeps the music and effects, and re-syncs the lips where a face is on screen. You get the dubbed video on an editable timeline, with the original sound still there to switch back.
Use invideo for this when you want speech timing, lip sync and the final mix in one project, with the original kept and a branch per language.
Quickest path
Set up your agent first with invideo for AI agents. Then give it this prompt.
Dub interview.mp4 into Spanish (Spain) in invideo. Show me the Spanishlines first. Keep the music. Re-sync the speaker's lips. Mute the originalvoice on a branch, don't delete it, and show me frames before you export.In a chat app, you drag the video into the project. In a terminal, the agent uploads the file you name.
What you need
These are the inputs for a good dub.
- The footage, with its sound.
- The target language, or the new lines if you are re-voicing in the same language.
- Who approves the new lines.
- The voice: a stock voice, or the original speaker's voice cloned with their consent from short clean clips.
- Whether faces are on screen. Lip sync costs more and is needed only where a mouth shows.
Steps
There are two ways to make the speech. The agent picks one with you. Both make one take per line, placed at the line's original time.
seed_audio_1_0.ta2aspeaks your lines in the original speaker's voice, from one to three reference clips tagged@Audio1to@Audio3.elevenlabs_text_to_speech.elevenlabs_tts_v4with a stock voice, as on Translate a training video and retime the cut to fit the new voice.
invideo has no model that dubs a whole video in one call. For that, use a dubbing service, named at the end of this page.
Bring the footage in and transcribe it
The agent adds the file with
add_media. It pricesaudio.transcriptwithdry_runon the file's sequence URL and 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.Write and approve the new lines
The agent translates or rewrites the lines, keeps their times, and shows you the script. It sees your yes or your changes.
Keep the music
The agent runs
mediaaudio.separateon the footage's sequence URL withdry_run, and tells you the price. For a price of 1 credit or more it waits for your yes. Then it runs it withmax_creditsset to that price and anidempotency_key. It sees new sequences for the voice and the rest of the sound.Make the new speech
- The agent runs
find_modelswith the job in words, such as "seed audio speech in a reference voice", picks a model, and reads its inputs withget_model. A good pick to keep the speaker's voice isseed_audio_1_0.ta2a, with a clean clip of the speaker asreference_audio_1, tagged@Audio1in theprompt. For a stock voice, a good pick iselevenlabs_text_to_speech.elevenlabs_tts_v4with avoice_idfromelevenlabs_text_to_speech_voices. 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-01-es. It gets a thread URL and, when the result lands, one audio sequence URL per line. It reads each URL withreadand never callsgenerateagain to check.
- The agent runs
Re-sync the lips
Where a face speaks on screen, the agent re-syncs the lips. The lip sync models take one audio file.
- The agent joins the line takes into one track with
mediaaudio.concat. - It runs
find_modelswith "lip sync", and reads its pick withget_model. A good pick issync_lipsync_v3.video. Your agent can search for others withfind_models. - It calls
generatewith the footage asvideo, the joined speech asaudioanddry_run: true, and tells you the price. - For a price of 1 credit or more it waits for your yes. Then it calls
generatewithmax_creditsset to that price and anidempotency_key. It reads the new video's sequence URL withread, and looks at it withmediavideo.framesbefore it uses it.
- The agent joins the line takes into one track with
Mix on a branch
The agent creates a branch with
timeline_history. On the branch it mutes the original sound withset_audio_mutedand places the music stem and each new line at its original start withinsert_media. It sees a newstate_token.Check, then export
The agent calls
captureon faces mid-sentence andcheck_timeline. Then it callsexport, and runsmediaaudio.loudnesson the export's sequence to check the mix. It sees an export card with statuscompleted.
The terminal version:
invideo edit new <project-url> --name "Interview ES"invideo asset upload <edit-url> ./interview.mp4invideo media audio.transcript <footage-url> --dry-runinvideo media audio.transcript <footage-url> --max-credits <price>invideo media audio.separate <footage-url> --dry-runinvideo media audio.separate <footage-url> --max-credits <price> \ --idempotency-key stems-1invideo gen models <project-url> --query "seed audio reference voice"invideo gen model <project-url> --model seed_audio_1_0.ta2ainvideo gen run <page-url> --model seed_audio_1_0.ta2a --dry-run \ --input line-01-es.jsoninvideo gen run <page-url> --model seed_audio_1_0.ta2a \ --max-credits <price> --idempotency-key line-01-es --input line-01-es.jsoninvideo gen models <project-url> --query "lip sync"invideo gen model <project-url> --model sync_lipsync_v3.videoinvideo gen run <page-url> --model sync_lipsync_v3.video --dry-run \ -i video=<footage-url> -i audio=<speech-url>invideo gen run <page-url> --model sync_lipsync_v3.video \ --max-credits <price> --idempotency-key lipsync-1 \ -i video=<footage-url> -i audio=<speech-url>invideo status <thread-url> --waitinvideo notebook show <thread-url>invideo edit show <edit-url> --jsoninvideo branch new <edit-url> --name dub-es --token <state_token>invideo edit show <branch-url> --jsoninvideo edit change <branch-url> --timeline T1 --token <state_token> \ --operations @mix.jsoninvideo edit check <branch-url>invideo edit export <branch-url> --format video --quality 1080 --jsoninvideo status <card-url> --waitinvideo notebook show <card-url> --out ./outThe file line-01-es.json holds the model's inputs alone, as get_model lists them, with no inputs wrapper. The dry run and the paid run read the same file, so the run that spends is the run that was priced.
{ "prompt": "@Audio1, calm and clear: \"Bienvenidos al curso.\"", "reference_audio_1": "<speaker-clip-sequence-url>"}Where each value comes from:
<project-url>comes frominvideo project new, and<edit-url>frominvideo edit new.<footage-url>is theurlthatinvideo asset upload <edit-url>returns, a…/notebook/seq-N.MURL.<speaker-clip-sequence-url>is the sequence URL of a clean clip of the speaker, such as the voice stemaudio.separatemakes.<price>is each dry run's.estimated_credits.<page-url>is a notebook page of the project, listed byinvideo notebook show <project-url>.<speech-url>is the joined track fromaudio.concat.<thread-url>is theurlthe paidgen runreturns, andnotebook showon it lists the new video.<branch-url>is thebranch_urlthatinvideo branch newreturns.<state_token>comes frominvideo edit showon the URL the next command runs on:<edit-url>forbranch new, then<branch-url>, read again before each change.@mix.jsonreads a bare JSON list of ops:set_audio_mutedon the original sound andinsert_mediafor each new line.<card-url>is.sequences[0]of the export answer.invideo statuswaits but saves nothing.invideo notebook showsaves the video as./out/export.mp4, and the agent renames it.
The MCP generate call for one line, in the speaker's own voice, as a dry run. Over MCP the inputs go inside inputs. The paid call is the same with max_credits set to the price and an idempotency_key, without dry_run.
{ "model": "seed_audio_1_0.ta2a", "dry_run": true, "inputs": { "prompt": "@Audio1, calm and clear: \"Bienvenidos al curso.\"", "reference_audio_1": "<speaker-clip-sequence-url>" }}For a file without a timeline, media video.replaceAudio on the file's sequence URL, with audio_input, makes a new video with the new sound. The timeline path keeps the original, so prefer it.
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, stem separation, the new speech, and lip sync, which is the largest part.
- Free: every edit, branch and export.
- The tool ops in
media, likeaudio.concat: the dry run shows the price before anything starts.
A short clip takes a few minutes of agent time plus generation. Lip sync takes longer. See Credits for prices.
If something goes wrong
Most problems are length, voice or lips.
| 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. |
| CLI exit 2 "inputs is not an input of this model" | The --input file has an inputs wrapper. Put the model's inputs at the top level of the file. |
audio.transcript or audio.separate refused with code: "not_found" | The call named a media bin asset. Pass the footage's sequence URL from add_media or invideo asset upload. |
invideo status --wait ends and the folder is empty | status does not download. Run invideo notebook show <card-url> --out <dir>. |
| A new line overlaps the next | Shorten the line, or open time on every track with edit_time_range mode insert. |
seed_audio_1_0.ta2a refuses the inputs | It needs reference_audio_1, and each clip must meet the limits get_model lists. |
sync_lipsync_v3.video refuses the speech | It takes one audio file. Join the takes with audio.concat, or export the dubbed timeline with export mode audio and pass that. |
| The lips drift at the end | The speech and video lengths differ. Set sync_mode on sync_lipsync_v3.video, or trim the speech first. |
| The music is gone | The original sound was muted whole. Place the music stem from audio.separate. |
| The cloned voice sounds off | Use clean reference clips with one speaker and no music. |
Exit code 6, or status is held | A safety review, not a refusal. Wait, then run invideo status <url> --wait again. Do not resend. If it ends failed, change the input the review flagged. |
timeout on generate | Send the same call again with the same idempotency_key. It finds the first generation and does not pay twice. |
| Avoid: delete the original sound | Instead: mute it with set_audio_muted on a branch. |
Prompts to try
Each prompt is a real variation of this job.
Re-voice this narrator in a younger female voice, same words, same timing.No lip sync, the narrator is off screen.Make a quick German draft of this English video in a stock voice, onetake per line. Keep the music. I'll decide on lip sync after.Dub only the first speaker in this panel into French. Keep the others inEnglish.When to use something else
Clone a voice only with the speaker's consent. For many speakers, many languages and a review workflow, a dubbing service such as ElevenLabs Dubbing or HeyGen video translation does the whole job, and invideo finishes the cut and captions. invideo does not judge translation quality, so a native speaker reviews the lines.