video-localization
Skill1 starsChanged 7 months agoMITView on GitHub
Use when localizing a single YouTube, web, or local video into another language with translated dubbing, sentence-level alignment, bilingual subtitles, final deliverables, or authorized reference-audio voice cloning.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- nexmoe/VidBeetheir own version, first seen Nov 8, 2026
- eachlabs/skillstheir own version, first seen Apr 1, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- nexmoe/VidBee★ 11ksame name
- eachlabs/skills★ 46same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- clipSkill
- first-principles-designSkill
- pdf2mdSkill
- procurement-analysisSkill
- team-debateSkill
- travel-plannerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 15 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Reference-audio voice cloning: default mode; use authorized reference audio.
- Distinctive: line 34
Do not use this when:
- Very specific: line 51
Use ISO 639-1, BCP-47, or clear language names consistently.
- Distinctive: line 55
Create an isolated work directory next to the source video.
- Very specific: line 75
Keep shared .venv/ and models/ in the source video's parent directory, not inside the per-video work directory, so multiple localization …
- Distinctive: line 103
If browser state, login, network requests, or CAPTCHA need inspection, use the repository's browser tooling rules.
- Distinctive: line 104
If browser access is also blocked, stop bypass attempts and ask the user for a local media or subtitle file.
- Very specific: line 109
Use ffprobe to save metadata and confirm duration, video stream, and audio stream.
- Very specific: line 115
Prefer faster-whisper for text and SRT.
- Distinctive: line 118
If model download fails, check proxy/cache first.
- Distinctive: line 122
Write natural, concise, spoken target-language narration.
- Very specific: line 125
Treat scaffold_rewrite_prompt.py output as a manual prompt scaffold, not the final script.
- Very specific: line 144
Default mode: use Qwen3-TTS or another authorized zero-shot voice-cloning backend with source/reference.wav and source/reference.txt.
- Distinctive: line 146
Do not use a backend or voice trained for a different target language.
- Very specific: line 148
Verify generated audio is playable, non-silent, reasonable duration, and usable by ffmpeg.
- Distinctive: line 153
Use each SRT block start time as an anchor and place generated target-language segments on the original timeline.
- Distinctive: line 154
If a target segment is too long, first apply bounded speed-up, then trim only if necessary.
- Very specific: line 167
Use ffprobe to confirm final MP4 contains both video and audio streams.
- Very specific: line 173
Use {lang_pair} in subtitle and bilingual video names.
- Distinctive: line 229
Default voice-cloned aligned dubbing:
- Distinctive: line 310
Do not claim completion if any are true:
- Distinctive: line 313
Only a prompt scaffold exists.
- Distinctive: line 314
Default voice cloning was skipped without a recorded reason.
- Distinctive: line 317
Only total-duration alignment was done but sentence-level sync is claimed.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Video Localization
Overview
Localize one video into another language with reproducible, auditable, real deliverables. The workflow favors verifiable artifacts over black-box automation or studio-grade promises.
Core principle: every step must leave evidence. Save commands, failures, fixes, transcripts, scripts, generated audio, subtitles, timing reports, and final outputs in a work directory next to the source video. Do not claim completion from prompt scaffolds, placeholder audio, total-duration-only alignment, or theoretical steps.
Default dubbing mode:
- Use reference-audio voice cloning unless the user explicitly requests standard TTS or no authorized reference audio is available. Prefer a user-supplied reference clip; otherwise extract a clean 3-15 second single-speaker clip from the source video when rights and audio quality are acceptable. If voice cloning cannot be used, fall back to standard target-language TTS and record the reason in
notes/issues.mdorreport.md.
Supported modes:
- Reference-audio voice cloning: default mode; use authorized reference audio. Default to a clean 3-15 second single-speaker clip extracted from the source video only when appropriate; switch to user-provided reference audio if supplied.
- Standard target-language dubbing: fallback or explicit mode; synthesize narration with a TTS voice that explicitly supports the target language.
Out of scope: batch pipelines, automatic voiceprint purification, voice authentication, lip sync, rights bypassing, or guaranteeing 100% speaker replication.
When to Use
Use this when:
- User provides a YouTube URL, web video, or local video and asks for translation, dubbing, subtitles, or localized video output.
- The task needs source-language transcription, target-language narration, sentence-level sync, bilingual subtitles, or title-named final files.
- User asks for voice cloning with a clear reference-audio source and acceptable usage rights.
- Manual script review is needed before TTS to avoid literal or awkward translation.
Do not use this when:
- Processing many videos as a batch system.
- The source, subtitles, translated script, or reference audio lack clear processing permission.
- User requests unaudited processing with no intermediate artifacts.
- The goal is lip-sync, identity verification, or impersonation without authorization.
Language and Naming Conventions
Confirm the language direction before producing final artifacts:
| Placeholder | Example | Meaning |
{src_lang} | en, zh, es, fr | Main source-video language |
{tgt_lang} | zh, en, de, ja | Target narration/subtitle language |
{lang_pair} | en-zh, es-en | Source-to-target direction |
Use ISO 639-1, BCP-47, or clear language names consistently. For edge-tts, use a concrete voice locale such as zh-CN-XiaoxiaoNeural, en-US-AriaNeural, fr-FR-DeniseNeural, or ja-JP-NanamiNeural; run edge-tts --list-voices to choose a voice matching {tgt_lang}.
Work Directory Convention
Create an isolated work directory next to the source video. The directory name is the source filename stem:
/path/to/Source-Video.mp4
/path/to/Source-Video/
/path/to/Source-Video/output/Internal layout:
/path/to/Source-Video/
source/ # normalized inputs and reference audio/text
artifacts/ # transcripts, scripts, TTS, subtitles, intermediate video
notes/ # commands, issues, manual checks, constraints
output/ # user-facing final files
scripts/ # copied skill scripts
report.md # final summaryKeep shared .venv/ and models/ in the source video's parent directory, not inside the per-video work directory, so multiple localization tasks can reuse dependencies and model weights. Ensure that parent-level .gitignore ignores .venv/ and models/.
Minimum artifacts:
| Artifact | Description |
source/video.mp4 | Normalized video input |
source/audio.mp3 | Extracted or user-provided audio |
artifacts/transcript.{src_lang}.txt | Source-language transcript |
artifacts/transcript.{src_lang}.srt | Timed source-language SRT |
artifacts/script.{tgt_lang}.txt | Continuous target-language narration script |
artifacts/script.{tgt_lang}.segments.txt | One target-language line per SRT block |
source/reference.wav and source/reference.txt | Reference audio/text for voice cloning |
artifacts/narration.{tgt_lang}*.wav/mp3 | Real generated target-language audio |
artifacts/narration.{tgt_lang}.aligned.json | Segment timing report |
artifacts/subtitles.{lang_pair}.ass | Internal bilingual subtitle artifact; keep {lang_pair} to avoid collisions |
output/{title}.{tgt_lang}.mp4 | Clean localized video |
output/{title}.{lang_pair}.ass | External bilingual subtitle file |
output/{title}.{lang_pair}-bilingual.mp4 | Burned bilingual subtitle video |
notes/commands.md | Actually executed commands |
notes/issues.md | Blockers, fixes, fallbacks, constraints |
report.md | User-facing summary of what actually ran |
Recommended Workflow
1. Acquire and verify source media
- For YouTube or web links, try
yt-dlpfirst, but do not treat429, bot verification, login checks, or CAPTCHA as ordinary parameter errors. - If browser state, login, network requests, or CAPTCHA need inspection, use the repository's browser tooling rules.
- If browser access is also blocked, stop bypass attempts and ask the user for a local media or subtitle file.
- Record acquisition method, failures, final source path, and source permissions.
2. Normalize media inputs
- Use
ffprobeto save metadata and confirm duration, video stream, and audio stream. - Copy or transcode to stable paths:
source/video.mp4andsource/audio.mp3. - Quote paths with spaces. Prefer canonical internal paths for scripts.
3. Transcribe source audio
- Prefer
faster-whisperfor text and SRT. - Specify
--language/--source-langwhen the source language is known; otherwise allow auto-detection. - Sample-check transcript quality: names, numbers, technical terms, sentence breaks, and SRT block count.
- If model download fails, check proxy/cache first; do not fabricate subtitles.
4. Produce target-language script
- Write natural, concise, spoken target-language narration; preserve meaning over literal translation.
- For continuous narration, create
artifacts/script.{tgt_lang}.txt. - For sentence-level sync, create
artifacts/script.{tgt_lang}.segments.txtwith exactly one line per SRT block. - Treat
scaffold_rewrite_prompt.pyoutput as a manual prompt scaffold, not the final script. Overwrite it with reviewed final target-language text before TTS.
5. Prepare reference audio for voice cloning
Default source-extracted reference:
ffmpeg -y -ss 00:00:02.640 -to 00:00:15.000 \
-i source/video.mp4 \
-vn -ac 1 -ar 24000 -c:a pcm_s16le \
source/reference.wav
printf '%s\n' 'Exact spoken text for this reference clip.' > source/reference.txtReference audio should be single-speaker, low-noise, 3-15 seconds, no music/crosstalk/reverb, and paired with exact reference text unless using an explicit x-vector-only mode. Record time range or file path, source, authorization, quality constraints, and text source. If no authorized reference can be prepared, switch to standard TTS rather than fabricating clone quality.
6. Generate real target-language TTS
- Default mode: use Qwen3-TTS or another authorized zero-shot voice-cloning backend with
source/reference.wavandsource/reference.txt. - Fallback or explicit standard mode: use
edge-ttsor another backend that supports{tgt_lang}. - Do not use a backend or voice trained for a different target language. Wrong pronunciation, romanization/pinyin output, garbled speech, or silence means the backend choice failed.
- Silent, blank, corrupt, or placeholder files are not completion.
- Verify generated audio is playable, non-silent, reasonable duration, and usable by
ffmpeg.
7. Align to source timeline
- For sentence-level sync, do not stretch one full narration to the total video duration.
- Use each SRT block start time as an anchor and place generated target-language segments on the original timeline.
- If a target segment is too long, first apply bounded speed-up, then trim only if necessary. Save and report speed-up/truncation data.
8. Generate subtitles
- Produce standalone subtitles before deciding whether to burn them into video.
- Bilingual subtitles must reuse source SRT timing and pair each source block with its matching target-language segment.
- Distinguish external subtitles, hard subtitles, and soft subtitles in the report.
- Name subtitle files with
{lang_pair}(e.g.subtitles.en-zh.ass) so multiple language pairs can coexist without filename collision.
9. Compose final video
- Replace or overlay the source audio track with the dubbed audio.
- Unless the user specifies another codec, encode deliverable MP4 files with H.264 video and AAC audio:
-c:v libx264 -c:a aac. - Use
ffprobeto confirm final MP4 contains both video and audio streams. - Export final named files into
output/; do not leave only internalartifacts/final*.mp4files.
10. Package and report
- Copy the clean video, subtitle file, and burned subtitle version to
output/using user-requested names. - Use
{lang_pair}in subtitle and bilingual video names; use{tgt_lang}in the clean dubbed video name. report.mdmust describe only commands and artifacts that actually ran in the current environment.- Include limitations: transcription quality, TTS backend, voice-clone reference quality, speed-up/truncation, network/model constraints.
Bundled Scripts
Copy scripts into the work directory's scripts/ folder before running so the task archive is self-contained.
| Script | Purpose |
scripts/transcribe_with_faster_whisper.py | Transcribe audio to text and SRT |
scripts/scaffold_rewrite_prompt.py | Generate a human-review translation prompt scaffold |
scripts/generate_edge_tts.py | Synthesize a continuous script to MP3/WAV via edge-tts |
scripts/generate_qwen3_voice_clone.py | Synthesize with reference-audio voice cloning via Qwen3-TTS |
scripts/build_aligned_dub.py | Per-segment synthesis aligned to source SRT start times |
scripts/build_bilingual_ass.py | Generate bilingual ASS subtitles from source SRT and target segments |
Common setup and fallback standard-TTS commands:
python scripts/transcribe_with_faster_whisper.py \
--audio source/audio.mp3 \
--txt-out artifacts/transcript.{src_lang}.txt \
--srt-out artifacts/transcript.{src_lang}.srt \
--language {src_lang}
python scripts/scaffold_rewrite_prompt.py \
--transcript artifacts/transcript.{src_lang}.txt \
--output artifacts/script.{tgt_lang}.txt \
--source-lang <SourceLanguageName> \
--target-lang <TargetLanguageName> \
--mode continuous
python scripts/generate_edge_tts.py \
--script artifacts/script.{tgt_lang}.txt \
--voice <voice-id-for-{tgt_lang}> \
--mp3-out artifacts/narration.{tgt_lang}.mp3 \
--wav-out artifacts/narration.{tgt_lang}.wav
python scripts/build_aligned_dub.py \
--srt artifacts/transcript.{src_lang}.srt \
--tgt-segments artifacts/script.{tgt_lang}.segments.txt \
--video source/video.mp4 \
--backend edge-tts \
--voice <voice-id-for-{tgt_lang}> \
--wav-out artifacts/narration.{tgt_lang}.aligned.wav \
--report-out artifacts/narration.{tgt_lang}.aligned.json \
--segment-dir artifacts/aligned-segments
python scripts/build_bilingual_ass.py \
--srt artifacts/transcript.{src_lang}.srt \
--tgt-segments artifacts/script.{tgt_lang}.segments.txt \
--lang-pair {src_lang}-{tgt_lang} \
--ass-out artifacts/subtitles.{src_lang}-{tgt_lang}.assDefault voice-cloned aligned dubbing:
python scripts/generate_qwen3_voice_clone.py \
--script artifacts/script.{tgt_lang}.txt \
--reference-audio source/reference.wav \
--reference-text source/reference.txt \
--language <TargetLanguageName> \
--mp3-out artifacts/narration.{tgt_lang}.clone.mp3 \
--wav-out artifacts/narration.{tgt_lang}.clone.wav
python scripts/build_aligned_dub.py \
--srt artifacts/transcript.{src_lang}.srt \
--tgt-segments artifacts/script.{tgt_lang}.segments.txt \
--video source/video.mp4 \
--backend qwen3-tts \
--reference-audio source/reference.wav \
--reference-text source/reference.txt \
--language <TargetLanguageName> \
--model-id ../models/Qwen3-TTS-12Hz-0.6B-Base \
--segment-dir artifacts/aligned-segments-clone \
--wav-out artifacts/narration.{tgt_lang}.clone.aligned.wav \
--report-out artifacts/narration.{tgt_lang}.clone.aligned.json
# Compose clean localized video with default delivery codecs
ffmpeg -y \
-i source/video.mp4 \
-i artifacts/narration.{tgt_lang}.clone.aligned.wav \
-map 0:v:0 -map 1:a:0 \
-c:v libx264 -c:a aac -shortest \
output/{title}.{tgt_lang}.mp4
# Burn bilingual ASS subtitles with the same default delivery codecs
ffmpeg -y \
-i output/{title}.{tgt_lang}.mp4 \
-vf "ass=artifacts/subtitles.{src_lang}-{tgt_lang}.ass" \
-c:v libx264 -c:a aac \
output/{title}.{src_lang}-{tgt_lang}-bilingual.mp4Scripts accept compatibility aliases: --translated-segments, --target-segments, and --tgt-segments; --language, --target-lang, and --target-language; --source-lang and --source-language.
Note:
--source-lang/--target-lang/--languageforscaffold_rewrite_prompt.pyandgenerate_qwen3_voice_clone.pyaccept language names (e.g.English,Chinese,French).--languagefortranscribe_with_faster_whisper.pyandbuild_aligned_dub.pyaccepts ISO 639-1 codes (e.g.en,zh,fr).
Minimal Toolchain
ffmpeg/ffprobe: media extraction, conversion, stream verification, final composition.- Python virtual environment in the parent directory.
faster-whisper: transcription and SRT generation.edge-tts: standard TTS for supported locales.qwen-tts, PyTorch,soundfile: reference-audio voice cloning.numpy: segment mixing and WAV timeline construction.modelscope: recommended fallback for Qwen model weights when Hugging Face downloads fail.
Tesla P4 note: P4 compute capability is 6.1 and may require Python 3.12 plus torch==2.4.1+cu121. Verify CUDA with a minimal tensor script before Qwen inference. P4 does not support flash-attn; expect slow per-segment synthesis. Segment caching allows resume after interruption.
Troubleshooting
| Symptom | Response |
yt-dlp returns 429, bot verification, login, CAPTCHA | Inspect page state; if blocked, ask for local media/subtitles and record failure. |
| Hugging Face, YouTube, PyPI, or model downloads time out | Verify proxy and failing domains; use mirrors/cache where appropriate; do not rewrite workflow prematurely. |
Python proxy parse error like Invalid port: ':1]' | Check proxy env vars; some libraries misparse NO_PROXY=[::1]; temporarily unset only for affected commands. |
| faster-whisper model unavailable | Check ~/.cache/huggingface, ~/.cache/ctranslate2, proxy, and local cache; request SRT/transcript if unavailable. |
| Qwen model download fails on Hugging Face | Prefer ModelScope and create a symlink if . becomes ___ in the local directory name. |
| Current Python too new for GPU PyTorch | Create a Python 3.12/3.11 virtualenv; do not pollute system Python. |
qwen-tts upgrades PyTorch incompatibly | Install verified PyTorch first, then install qwen-tts --no-deps and add dependencies based on import errors. |
transformers, huggingface-hub, or accelerate version conflicts | Pin the version required by the actual import error; do not blindly upgrade all packages. Re-run import checks after each pin. |
uv python install fails on GitHub release download | Use a Python build mirror such as uv python install 3.12 --mirror 'https://gh.llkk.cc/https://github.com/astral-sh/python-build-standalone/releases/download'. |
GPU PyTorch fails on Tesla P4 with no kernel image is available for execution on the device | P4 is compute capability 6.1. Use a compatible Python and PyTorch build, commonly Python 3.12 plus torch==2.4.1+cu121, then validate CUDA with a tiny tensor script before Qwen inference. |
SoX could not be found warning | Determine whether it blocks execution; if synthesis continues, log the limitation and proceed. |
| TTS backend does not support target language | Choose a backend/voice that supports {tgt_lang}; failed pronunciation, romanization/pinyin, garbled speech, or silence is not completion. |
| No authorized reference audio is available for default voice cloning | Fall back to standard TTS, record why voice cloning was skipped, and do not imply cloned voice quality in the report. |
| Voice clone does not match reference | Re-check single speaker, 3-15 s duration, no music/reverb/crosstalk, exact reference text. |
| Final duration correct but sentences drift | Rebuild per-segment audio anchored to SRT starts; total-duration alignment is insufficient. |
| Segment count mismatch | Ensure target segment lines exactly equal SRT block count; no merged, split, blank, or numbered lines. |
| User requested subtitles but only video exists | Produce requested external, hard, or soft subtitle deliverable and label it correctly. |
| User requested title-named output but only artifacts exist | Add packaging/export step into output/ and verify final filenames exist. |
Red Flags
Do not claim completion if any are true:
- Source/target language direction is unclear.
- Only a prompt scaffold exists; final target-language script has not been reviewed.
- Default voice cloning was skipped without a recorded reason.
- TTS backend does not support the target language, or output is silent, blank, corrupt, garbled, romanized/pinyin, or placeholder.
- Voice cloning is claimed without authorized reference audio and quality notes.
- Only total-duration alignment was done but sentence-level sync is claimed.
- Final MP4 was not verified with
ffprobefor video and audio streams. - Final MP4 was delivered without user-requested codecs, or without default H.264/AAC when codecs were unspecified.
notes/commands.mdandnotes/issues.mddo not record real commands, failures, fixes, and constraints.- Final user-requested files are missing from
output/.
Pre-Delivery Checklist
{src_lang},{tgt_lang},{lang_pair}, output filenames, and subtitle requirements are clear.- Work directory is next to the source video and contains
source/,artifacts/,notes/,output/,scripts/, andreport.md. - Source video/audio, transcript, reviewed target script, TTS audio, subtitles, timing report, and final video have documented paths.
- Key commands are written to
notes/commands.md. - Blockers, fallbacks, quality limits, and authorization notes are written to
notes/issues.mdorreport.md. - If sentence-level sync was requested, timing report records speed-up/truncation.
- If voice cloning was used, reference audio source, quality, reference text, and authorization are recorded in
notes/issues.mdorreport.md. - If voice cloning was not used, the reason and standard-TTS fallback are recorded.
- Final MP4 passed
ffprobevideo/audio stream verification. - Final MP4 uses user-requested codecs, or default H.264 video and AAC audio when unspecified.
- All requested final filenames and subtitle formats exist in
output/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

