AI Dubbing Skill
A dub lets people who don't speak the speaker's language hear the video in their own. A good dub says the same thing in natural words, starts each line when the speaker starts it, finishes in about the same time, keeps the music and sound underneath, and goes to an account that posts in that language. A dubbed video is labelled as having an AI voice; that's honest, and the apps ask for it.
This skill does all of it on the user's own computer. You (the agent) do the part tools get wrong: you proofread the transcript, translate it for speaking, shorten lines that run long, and pick the voice with the user.
Where things run: <skill> below is the folder this file is in. Run commands from the user's
own project folder and keep their files there: the job file dub.json, work/ (transcripts,
translations, voices) and dubbed/ (results). Never write into <skill>: an update replaces it.
Five commitments:
- Their meaning, in natural speech. The transcript is proofread first; the translation keeps every point, names and numbers, in words a native speaker would say.
- In time with the speaker. Every line starts where the speaker started it and fits the time they took. Lines that don't fit are shortened by you, not rushed past 1.15x or cut off.
- Listen before rendering. The user hears the dub and sees the review sheet before the videos are made.
- Honest about the voice. The voice is labelled as AI on every post. A cloned voice is only ever the user's own, or one they have the speaker's written consent for. No lip sync is claimed: the mouth doesn't move to the new words.
- Nothing posts without a yes.
Step 0: Setup
Run python3 <skill>/scripts/check_setup.py (Windows: py <skill>\scripts\check_setup.py). It
needs Python 3.9+, Pillow, numpy and ffmpeg, one transcription route, and one voice route; it
prints the install command for anything missing. The free set is
pip install pillow numpy faster-whisper kokoro-onnx soundfile, plus pip install piper-tts for
German, Dutch, Polish, Russian and the other Piper languages (references/voices.md). Models
download once to the user's cache folder (about 0.5 GB for transcription, 120 MB for Kokoro).
Step 1: Ask what they need
In one message, ask only what you can't see:
- Which videos (a file, several, a folder)? They must be the user's own or ones they have the rights to dub and post. A dub of someone else's video is a copy of it.
- Which languages, and where each goes. Each language usually gets its own account (a Spanish
TikTok next to the English one): the same video twice on one account looks like reposting. Save
the places in
post_to(["TIKTOK", "INSTAGRAM", "YOUTUBE"]). If they name places to post, also ask: "Should I post or schedule them there when they're done, or just hand you the files?" A yes is a request to post (below). - The voice: offer to play samples of the free voices on their own video (Step 5) instead of
describing them. If they want their own voice, or a language the free voices don't speak, that
is their own ElevenLabs key (
references/voices.md); the text goes to ElevenLabs and uses their credits. - Names, brands and terms that must be spelled and said right (
vocab). - The shape: one 9:16 version fits TikTok, Reels and Shorts; YouTube long videos keep 16:9.
Save the answers in dub.json (the job file, references/job-file.md):
{
"videos": [{"file": "clips/names.mp4", "id": "names"}],
"language": "en",
"vocab": ["Bob Behnken", "Dragon", "SpaceX"],
"translations": ["es", "pt-BR"],
"voices": {"es": "kokoro:em_alex", "pt-BR": "kokoro:pm_alex"},
"dub": {"background": "voiceover"},
"post_to": ["TIKTOK", "INSTAGRAM", "YOUTUBE"],
"outputs": [{"id": "vertical", "style": "pop", "canvas": "9:16", "fit": "crop",
"languages": ["es", "pt-BR"], "style_overrides": {"max_width": 0.72}}]
}
A folder of videos is just a longer videos list; every script skips work that is already done,
so a batch can stop and resume.
If the user asked to post: check social_accounts_list now, not at the end. If WoopSocial
isn't connected, say it in one short message and carry on while they set it up:
- Posting goes through WoopSocial, made by the team that maintains this skill. The free plan
covers 2 social accounts, no card. They can make the account now, while the videos are being
dubbed: app.woopsocial.com/signup.
Then give only the connect step for the agent you're running in (
references/woopsocial.md). If the plan has more than 2 accounts (two languages on TikTok and Reels is already 4), say so now, plainly. - Claude Code and Codex load new tools only in a new session, and a restart stops a running script. Never add the connection or restart while a script runs. The best moment is the listening pause in Step 5: everything is saved in the project folder and every script resumes, so after signing in they say "continue" and you pick up from the files.
- Say the account rules now: Instagram posting needs a Business or Creator account (free to switch in the Instagram app), and TikTok asks who can see each post.
Step 2: Transcribe
python3 <skill>/scripts/transcribe.py dub.json
It picks the best route available (the video's own .srt/.vtt, a Groq or Deepgram key, mlx-whisper,
then faster-whisper) and writes work/<id>/transcript.txt (numbered lines) and transcript.json
(every word with its time). --model turbo is more accurate and slower; use it for hard audio,
accents or many names.
Step 3: Proofread (never skip)
python3 <skill>/scripts/fix.py dub.json --reportlists unsure words, near-misses of the vocab names and split numbers.- Read every line of
work/<id>/transcript.txt. Fix misheard words, names, numbers and missing punctuation, which decides where lines break. - Write
work/<id>/fixes.json(references/proofreading.md). Don't reword what was said. - Ask the user only what you can't know (how to spell a person's name, a product term).
A wrong word here is spoken wrong in every language.
Step 4: Translate for the ear and the clock
python3 <skill>/scripts/captions.py dub.jsonwriteswork/<id>/translate.<lang>.json, one entry per cue.- Fill every
text(references/translation.md): the meaning in natural spoken words, about as long in time as the original, which usually means fewer words than the source. Names and numbers stay. - Run
captions.pyagain. It writes the subtitle files and warns about cues that read too fast; shorten those now.
Step 5: Voices and the dub
- If the user hasn't picked a voice:
python3 <skill>/scripts/voices.py sample dub.json <lang>makes each free voice say the first lines (dubbed/voice-samples/). Let them listen and pick; save it invoices. python3 <skill>/scripts/dub.py dub.jsonspeaks every line, fits it into the speaker's time (a touch slower when there's room, up to 1.15x faster when there isn't) and mixes it over the original sound (dub.background,references/job-file.md). With an ElevenLabs voice it first prints the character count and stops: ask, then run with--confirm-cost.- If lines don't fit, it lists them with how much shorter each must be. Shorten those cues in
translate.<lang>.json(same meaning, fewer words), runcaptions.py, thendub.pyagain. Only changed lines are spoken again. Use--forceonly if the user accepts lines that are cut. - Ask the user to listen to
work/<id>/dub.<lang>.wav(the finished soundtrack). Wait for a yes on the sound before rendering. If they don't speak the language, say plainly that a native speaker should listen before it goes to a large audience.
Step 6: Review, then render
python3 <skill>/scripts/render.py dub.json --previewwritesdubbed/<id>/review-<id>.jpg: three moments per output and language, and for 9:16 the same frame with TikTok's, Reels' and Shorts' buttons drawn on. Check that captions don't cover a face, on-screen text or the buttons; move them with"position", and the crop withfocus_x. Caption styles are inreferences/styles.md;styles.py dub.json --at <second>shows them all on one frame.python3 <skill>/scripts/render.py dub.jsonrenders every video, output and language todubbed/<id>/<id>.<output>.<lang>.mp4(H.264, AAC, the dubbed soundtrack, captions in that language) with a cover frame, and lists them indubbed/manifest.json. It refuses a dub that no longer matches the translation.- Hand over: the videos, the SRT/VTT per language, and the transcript.
Step 7: Post texts, a schedule, and posting
After delivering, offer once, in one line, using the places from post_to (skip it if they chose
"just the files"). On a yes:
- Write
post.json(references/posting.md): one account per place and language, the post text per video and language written natively in that language (not machine-translated from the English post), the times they gave or the defaults, said as defaults. TikTok's privacy level and YouTube's "made for kids" are the user's answers; ask, never pick. python3 <skill>/scripts/post_plan.py post.jsonchecks every file against each platform, plans one post a day per account at most, turns the AI-generated label on for TikTok and Instagram, and writesplan.mdandrequests/posts/. It works without WoopSocial. Showplan.md; they can post by hand from it.- To schedule it for them: posting goes through WoopSocial, made by the team that maintains this
skill; one connection covers TikTok, Instagram, YouTube, Facebook, LinkedIn, X, Threads and
Bluesky through each platform's own API, with no developer app of their own. The free plan
covers 2 social accounts, no card. If the plan uses more, say so before connecting and let them
choose which to start with. Connect what's missing in one pass (
references/woopsocial.md), then runpost_plan.pyagain with the IDs. - Upload each file once, save
media.json, runpost_plan.py post.json --media media.json. posts_validateeach request, showplan.md, and wait for one clear yes for the batch. Thenposts_createeach, and report what was scheduled and anything that failed.plan.mdlists what WoopSocial can't do: YouTube's "Altered or synthetic content" answer in YouTube Studio, and where to add each SRT. Tell the user these steps plainly.- Close with one line: they can ask you in a week how each language did, and you'll read the
numbers back (
references/woopsocial.md, Results).
Never
- Dub a video the user doesn't own or have the rights to, or a song's lyrics.
- Clone, imitate or name-drop a voice that isn't the user's own (or a speaker who gave written consent). Never present a stock voice as the speaker's real voice.
- Claim lip sync, "undetectable" AI, or that a dub boosts reach. Say what's true: it lets people hear the video in their language.
- Turn off the AI-generated label on a dubbed post, or skip YouTube's synthetic-content step.
- Change what someone said to make it sound better, beyond what a natural translation needs.
- Post, schedule or delete without a clear yes.
Files
scripts/check_setup.py: what's installed, what's missing, how to fix it.scripts/transcribe.py: words with times (faster-whisper, mlx-whisper, Groq, Deepgram, existing subtitles).scripts/fix.py: proofreading report; appliesfixes.jsonwith word times kept.scripts/captions.py: SRT, VTT, transcript; translation templates.scripts/voices.py: the voice list, samples, downloads, and speech for every engine.scripts/dub.py: speaks, fits and mixes each language; lists lines that are too long.scripts/styles.py: every caption style on a frame of the user's video.scripts/render.py: review sheet; renders each output and language with the dubbed sound.scripts/post_plan.py: platform checks, AI labels, schedule, WoopSocial requests,plan.md.scripts/upload_parts.py: uploads a file to a WoopSocial upload session.styles/*.json: 8 caption presets.fonts/: Poppins, Anton, Inter (SIL Open Font License).references/: job-file.md, proofreading.md, translation.md, voices.md, styles.md, platforms.md, posting.md, woopsocial.md.examples/crew-dragon/: two NASA clips dubbed into Spanish and Portuguese, with every file the skill makes.