AI Video Skills · Skill 6 of 10
AI video lip sync and dialogue
AI video lip sync works best when you keep the model's picture and ambience and replace its speech: record each line with one fixed TTS voice, pass it as an audio reference, then time-stretch the recording to the lips with WSOLA. Video models with native audio generate a different voice every shot and garble words in long or multi-speaker takes. This skill includes align_to_lips.py and loudness.py.
Install
Install this skill
The plugin and npx commands install all ten skills; the manual copy installs only this one.
/plugin marketplace add klakix-ai/ai-video-skills
/plugin install ai-video-skills@klakix-ai-videonpx skills add klakix-ai/ai-video-skillsgit clone https://github.com/klakix-ai/ai-video-skills.git
cp -r ai-video-skills/skills/ai-video-dialogue-and-voice ~/.claude/skills/Source: skills/ai-video-dialogue-and-voice/SKILL.md on GitHub (MIT). For Codex use ~/.codex/skills/; for Claude.ai download a zip from Releases.
Key rules
What the skill teaches
Short versions of the rules in the skill. The numbers come from our own productions.
Write lines short, one breath each, with on-screen lines at about 10 words or fewer for social.
Record the line with the character's fixed TTS voice before generating the video. Pick a professional library voice, not a designed one, and let the person choose from 2 to 3 candidates.
For expressive TTS models with tags, use stability about 0.5 and similarity about 0.8, meaningful tags such as [whispers] or [calling out], and no stacked emotion tags. [shouting] pushed a male voice to a childish pitch.
Pass the recorded line as an audio reference (@Audio1) so the model animates the lips to roughly the same words and rhythm.
Transcribe both the TTS take and the generated video's audio with word timestamps, then align the take to the lips with WSOLA (no pitch change). Pick the take that needs the least stretching, about 25% at most.
Only stretch on-screen speakers. Off-screen or behind-camera voices are placed at natural speed.
Build the bed from the model's own audio, which is already in sync: duck its speech by 40 dB inside a mask of word times plus or minus 0.12 s and apply a fixed gain. Never loudness-normalize the ducked bed on its own, or the residual speech comes back as a ghost double.
Keep the model's own laughs; TTS laugh tags sound fake.
Mix to -14 LUFS integrated with true peak at -1 dBTP or lower. Lead character about -18 LUFS, side characters -19.5, off-screen voices -20.5, and speech at least 12 dB (ideally 18 dB or more) above the bed.
Verify by transcription: run speech-to-text on the final mix and check that every line reads correctly and the garbled words are gone.
Copy and adapt
Prompt patterns
Real wording from the skill. Swap in your own subject, lens and timings, and keep one move per shot.
@Audio1 is the recorded line for the woman at the door: match its words and rhythm.
The mother is unseen; we only hear her voice.
Leave 0.5 to 1 second of silence before the first word.Scripts
Scripts that come with it
Plain Python with no API keys or accounts. Install the dependencies with pip install opencv-python numpy, and keep ffmpeg on your PATH.
align_to_lips.pyAnchors every word start in the TTS take to the same word in the video's audio and time-stretches between anchors with WSOLA, with no pitch change. It reads two word-timestamp files; the words JSON format is a list of objects with word, start and end.
Examplepython align_to_lips.py --audio line_take2.mp3 --audio-words take2_words.json \ --video-words shot3_words.json --duration 5.04 --out shot3_voice.wavExamplepython align_to_lips.py --transcribe shot3.mp4 --language tr > shot3_words.jsonloudness.pyReports integrated loudness, loudness range and true peak through ffmpeg, so you can check the final mix and each stem against the targets.
Examplepython loudness.py final_mix.mp4 dialogue_stem.wav bed_stem.wav
FAQ
Common questions
How do I fix garbled speech in AI video?
Replace the model's speech instead of fighting it. Keep the video and its ambience, record the line with one fixed TTS voice, pass it as an audio reference, align it to the lips with WSOLA and duck the model's speech in the bed. Then transcribe the final mix to confirm every word.
What loudness should AI video dialogue have?
Aim for -14 LUFS integrated for social with true peak at -1 dBTP or lower. The lead character sits around -18 LUFS, side characters at -19.5 and off-screen voices at -20.5, with speech at least 12 dB above the bed. Measure with LUFS, because RMS matching does not match perceived loudness.
Can I dub AI video into another language?
Yes, with the same pipeline: record the translated line with the character's fixed voice, transcribe it with word timestamps and align it to the video's lip movement. Short lines work best; in long, multi-speaker takes the model's own speech gets garbled.
Keep going
Related skills
- Skill 03
Consistent character in AI video
Character bibles, sheets that do not drift, identity markers, per-shot reference sets and safety-filter tactics.skills/ai-character-consistency - Skill 07
Editing and pacing AI video
Measured shot-length rules, beat grids, never speeding up footage, upscale then grade, and shot_stats.py.skills/ai-video-editing-and-pacing - Skill 04
AI video prompts that follow instructions
Prompt structure, second-by-second timelines, Seedance 2.x reference maps, negative wording and model quirks.skills/ai-video-prompting
From the team behind the skills
Klakix has an AI voiceover tool and a talking photo tool if you want to record lines with a fixed voice and test lip-synced results.