
YouDub-webui
Self-hosted AI video dubbing: YouTube to Chinese, Bilibili to English
Replaces Rask Ai, Heygen, Maestra, Dubverse

Who it's for
Creators who publish to both YouTube and Bilibili can run YouDub-webui on a local machine or small server to automate dubbing across new uploads and back-catalog videos. The author's 20,000+ video Bilibili channel runs entirely on this pipeline.
If you process fewer than a handful of videos per month, a one-off cloud service may be simpler than the multi-step local setup and the GPU infrastructure overhead.
The FastAPI backend and modular pipeline design make YouDub-webui a reasonable starting point for a production localization service. Each stage (ASR, translation, TTS, mixing) is clearly separated, and the OpenAI-compatible translation hook makes swapping providers straightforward.
If you need managed infrastructure, SLA guarantees, or a multi-tenant architecture out of the box, a commercial API is a faster starting point than building on YouDub-webui.
Teachers and learners can use YouDub-webui to create dubbed versions of YouTube or Bilibili content for study use, preserving the original background audio while replacing the speech track in the target language.
If your source material is not on YouTube or Bilibili and you do not want to manage local file uploads, the two-entry-point design limits your workflow options.
The problem
Localizing a video into another language requires chaining six distinct processes: downloading the source video, separating speech from background audio, transcribing speech with accurate word-level timestamps, translating the transcript sentence by sentence, generating dubbed speech that matches the original speaker's voice, and mixing the result with background audio before burning subtitles. Assembling these tools into a reliable pipeline is significant engineering work. Commercial platforms like Rask AI, HeyGen, Maestra, and Dubverse handle this as managed cloud services, but charge per-minute or per-seat fees that scale with video volume. For a content creator publishing dozens of localized videos per month, a cloud service's free tier caps quickly and paid plans add up. Data residency is a secondary concern: uploading video content to a third-party cloud means your footage, speaker voice, and transcript all leave your infrastructure.
How it works
From YouTube or Bilibili URL to dubbed, subtitle-burned mp4 with no manual steps between. The pipeline runs download, source separation, ASR, translation, TTS, mixing, and subtitle burn as a single task. The web UI shows per-stage progress, timing, and logs; failed tasks resume from the failed stage without rerunning earlier steps.
Transcribes speech using openai-whisper, defaulting to the large-v3-turbo model. Output includes word-level timestamps, which are used to cut the original vocal track into per-sentence reference segments for the voice cloning stage. Runs on CUDA or CPU; MPS devices fall back to CPU for the float64-dependent timestamp alignment step.
Generates dubbed speech in the target language using VoxCPM2, cloning the original speaker's voice from reference audio segments cut from the source track. Dubbed segments are aligned to fit the original sentence durations, then mixed with the preserved background audio and burned into the final video file.
Separates the original video's vocal track from background music and sound effects using a Demucs source submodule. The background audio is preserved through the pipeline and remixed with the dubbed vocals in the final output, so background music and ambient sound carry through to the localized version.
Failed tasks restart from the stage that failed, reusing outputs from completed stages cached in the local work folder. The web UI displays per-task stage status, stage duration, and full running logs. Tasks can be deleted individually, including their log records and work folder contents, or rerun from scratch.
All intermediate files, the SQLite task database, YouTube cookies, and final output videos stay on your machine. Translation uses any OpenAI-compatible Chat Completions endpoint you configure, including locally run models. The backend enforces Argon2id password authentication and per-session CSRF protection on all API endpoints.
Features
- End-to-End Localization Pipeline
- Whisper Speech Recognition with Word-Level Timestamps
- VoxCPM2 Voice Cloning TTS
- Demucs Vocal and Background Separation
- Resumable Task Queue with Stage-Level Logs
- Local-First Storage with Configurable Translation API
How to install
Self-hosting requires cloning the repository with its Demucs submodule, then installing Python and Node.js dependencies before starting the backend and frontend services.
git clone https://github.com/liuzhao1225/YouDub-webui.git
cd YouDub-webui
git submodule update --init --recursive
python3.12 -m venv .venv
.venv/bin/pip install -r requirements.txt
npm --prefix apps/web install
cp env.txt.example .envRecommended for this setup
Strengths
- Production-Verified at Scale: The author's Bilibili channel has published 20,000+ videos, all dubbed using YouDub-webui. That track record confirms the pipeline handles regular, high-volume content production reliably, not just a proof-of-concept demo.
- No Per-Minute Fees or Upload Limits: Rask AI and HeyGen charge per minute of video processed. YouDub-webui runs on your own hardware, so your only ongoing costs are GPU compute time and the API fees for your chosen translation model. At high video volumes, the self-hosted path is significantly cheaper than any managed subscription.
- Modular Pipeline with Swappable Components: The ASR, translation, and TTS stages are independently replaceable. You can substitute a different ASR backend for Whisper, swap VoxCPM2 for another TTS system, or point the translation stage at any OpenAI-compatible endpoint including locally-run models. Clear stage boundaries in the FastAPI backend make each substitution targeted.
- Apache-2.0 License Permits Commercial Use: Apache-2.0 allows commercial use, modification, and distribution without a copyleft requirement. You can run YouDub-webui in a commercial content production operation or build services on top of it without releasing your changes, as long as you retain the original license notice.
Trade-offs
- GPU Required for Practical Use: CPU-only operation is supported but the README describes it as very slow for full transcription, source separation, and TTS workflows. A CUDA-capable NVIDIA GPU is recommended for any real video localization pipeline. Apple Silicon (MPS) is partially supported: Whisper falls back to CPU for word-level timestamp alignment due to MPS float64 constraints.
- Multi-Step Manual Setup Without Docker: There is no Docker image. Setup requires Python 3.12, Node.js 20+, FFmpeg, a Python virtual environment, submodule initialization for Demucs, environment variable configuration, and an Argon2id password hash generated interactively. The backend and frontend start as separate processes. The process involves significant manual steps across platforms.
- YouTube Access Requires Proxy and Cookies: Processing YouTube videos requires a locally accessible proxy and Netscape-format YouTube cookies exported from a logged-in browser session. Teams in regions without unrestricted YouTube access, or those without a suitable proxy, cannot process YouTube URL tasks without additional network configuration.
Tech stack
FAQ
The README documents two primary language routes: YouTube English-to-Chinese and Bilibili Chinese-to-English. Translation uses any OpenAI-compatible Chat Completions endpoint, so other language pairs work if your chosen model supports them. Whisper handles many languages for ASR. VoxCPM2 TTS quality for languages beyond the primary two has not been validated in the documented production case, so additional testing is advised before relying on other language pairs at scale.
A CUDA-capable NVIDIA GPU is strongly recommended. The README states that running Whisper transcription, Demucs source separation, and VoxCPM2 TTS on CPU is very slow for real video workflows. Setting DEVICE=cpu is supported for partial testing, but a complete video localization pipeline on CPU takes significantly longer per video. Apple Silicon (MPS) is partially supported: VoxCPM2 uses MPS, but Whisper runs on CPU on MPS devices due to float64 constraints in the word-level timestamp alignment step.
Apache-2.0 permits commercial use, modification, and distribution without a copyleft requirement. You can run YouDub-webui in a commercial content production operation or build a service on top of it without releasing your own changes as open source, as long as you retain the original Apache-2.0 license notice in any distribution.
Yes. YouDub-webui accepts local video uploads up to 4 GiB by default (configurable via LOCAL_UPLOAD_MAX_BYTES). You can also upload a pre-translated SRT subtitle file alongside a local video to skip the Whisper transcription and OpenAI translation stages, running only the voice cloning and subtitle burning steps. Uploading an SRT alongside a URL-based task is not supported in the current version.
Failed tasks can be resumed from the stage that failed without re-running earlier stages. The web UI displays per-stage status, duration, and full logs. Intermediate outputs from completed stages are cached in the local work folder and reused on resume. You can also delete a task's records and output files from the UI if you want to start fresh.