Localize YouTube or other foreign-language videos into Chinese. Use when Codex needs to turn a YouTube URL or local video into Simplified Chinese subtitles, Mandarin dubbing, and a final exported video; also use for requests about 自动下载 YouTube 视频、生成中文字幕、中文配音、混音、烧录字幕、导出成片.
Turn a YouTube URL or local video into a Chinese-localized deliverable:
Prefer the bundled script for repeatable work instead of reassembling the pipeline by hand.
Accept either:
Read references/runtime-requirements.md before first use or whenever the environment is missing tools. At minimum, the workflow expects . For YouTube URLs it also expects . For local speech-to-text it prefers . Translation uses Volcengine ; dubbing uses Volcengine TTS.
ffmpegyt-dlpfaster-whisperTranslateTextUse the default command first:
scripts/run_localize_video.sh \
--input "https://www.youtube.com/watch?v=..." \
--workdir ./runs/demo \
--cookies-from-browser edge
Useful variants:
scripts/run_localize_video.sh \
--input /path/to/video.mp4 \
--workdir ./runs/local-video \
--voice zh_female_qingxin \
--background-volume 0.12
scripts/run_localize_video.sh \
--input /path/to/video.mp4 \
--workdir ./runs/from-transcript \
--transcript-json /path/to/segments.json \
--skip-transcription
scripts/run_localize_video.sh \
--input "https://www.youtube.com/watch?v=..." \
--workdir ./runs/subtitles-only \
--skip-tts
Expect these files inside the work directory:
source.*: downloaded or copied source videoaudio.wav: extracted mono wav for speech processingtranscript.json: timestamped source segmentstranslated_segments.json: translated segments with Chinese textsubtitles.zh.srt: Simplified Chinese subtitlesdub_track.wav: synthesized Chinese dub track when TTS is enabledfinal_audio.wav: mixed final audiofinal.mp4: exported video deliverableCheck:
Prefer this order of execution:
faster-whisper if available.yt-dlp when the input is an online URL.Keep the translated Chinese concise. It is better to slightly compress the spoken line than to preserve every filler word and overrun the dub timing.
yt-dlp is missing, install it or ask for a local video file.--cookies-from-browser edge or another installed browser.faster-whisper is missing, install it or require --transcript-json.translated_text, stop and request either VOLCENGINE_ACCESS_KEY plus VOLCENGINE_SECRET_KEY or a pre-translated transcript.subtitles.zh.srt and export without burn-in rather than losing the localized result..venv