# Repository Briefing: liuzhao1225/YouDub-Desktop
> Source: https://repoforai.com/repo/liuzhao1225/YouDub-Desktop (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/liuzhao1225/YouDub-Desktop
- **Official Docs / Website**: https://liuzhao1225.github.io/YouDub-Desktop/
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: TypeScript
- **License**: Apache-2.0
- **Engineering Health**: A+ (95/100 · Maintenance 35/35 · Adoption 20/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.1.5 (2026-12-01) — https://github.com/liuzhao1225/YouDub-Desktop/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted, Local AI, GPU
- **Momentum**: 5,928 ★ total (+0 24h / +30 7d) · 634 forks
- **Topics**: `ai-dubbing`, `ai-video-translation`, `bilibili`, `demucs`, `fastapi`, `ffmpeg`, `multilingual-video`, `nextjs`, `open-source`, `python`, `speech-to-text`, `subtitle-translation`
- **When to Use**: Best for: Creators and localization teams with cleared source media who need local dubbing, subtitle review, and targeted reruns, and can maintain model dependencies. Skip if: A simple subtitle script meets your needs, or you need a zero-maintenance hosted service or a turnkey offline translation stack.

## Overview
```text
### Architecture & Core Mechanics
YouDub separates the desktop shell in `apps/desktop`, the Vite 8 and React 19 SPA in `apps/web`, and the Python runtime. Electron handles native window and directory controls, updates, the `safeStorage` credential bridge, and FastAPI process supervision. `backend/app/server/` is the single control plane: it serves `/api/*`, funnels progress through one SSE endpoint at `/api/events`, and combines SQLite WAL persistence with a task queue and DAG scheduler.

The ResourceManager launches heavy inference in separate Python subprocesses so their GPU allocations can be reclaimed when the stages finish. `backend/app/v1/` contains Whisper, SentenceX, Demucs, Qwen Aligner, VoxCPM2, and FFmpeg stages. The main points of configurability are the node graph and the translation provider protocols: users can set stage-specific options, pause for review, and rerun a corrected node instead of treating localization as a single opaque render.

### Key Capabilities & Differentiators
Inputs include local video files and YouTube, Shorts, Bilibili, and b23.tv links. Whisper defaults to `large-v3-turbo`; SentenceX uses word timestamps to reconstruct sentence boundaries while retaining timing mappings. Translation supports the OpenAI, Anthropic, and Gemini protocols, uses sliding context across sentences, and persists progress at sentence granularity so interrupted work can resume.

The workflow can keep the original audio and burn in translated subtitles, produce a dub with optional separated background audio, or export both subtitles and a dub with optional forced alignment. For voice cloning, VoxCPM2 uses the source audio from the corresponding sentence as its reference. The task library exposes stage progress, errors, and artifacts, with controls for cancellation, retry, regeneration, playback, and downloads.

### Trade-offs & Limitations
Compared with a Whisper-plus-FFmpeg script, YouDub adds persisted task state, editable graphs, dubbing, and targeted reruns, but brings a larger dependency and model footprint. Compared with a managed dubbing service, it gives operators more control over local media processing and review while leaving them responsible for model setup, GPU compatibility, and failures in URL ingestion. Local inference also does not make a workflow offline if translation sends text to a remote provider or ingestion fetches a video URL.

The app sets no fixed input cap on duration, size, resolution, or frame rate, but practical capacity depends on the chosen models, input characteristics, and concurrent work. The recent VoxCPM2 fixes address specific memory failure modes, not a guaranteed VRAM envelope. For adoption, test representative long clips and listen for voice consistency across sentence boundaries: per-sentence references preserve the mapping to source audio, but they do not establish uniform output quality.

### Hardware & Deployment Guide
The documented desktop downloads target Windows x64 and macOS arm64. First launch prepares the base environment, checks FFmpeg and `yt-dlp`, and lets users prepare dependencies and model weights for the chosen workflow. Source development requires Node.js `^22.19.0 || >=24.0.0`, Python 3.12, npm, and Git. Install the web and desktop dependencies separately, then use `npm run build` and `npm start`; `npm run dev:web` runs the local frontend and backend without Electron. The full developer requirements include all inference groups, whereas desktop setup installs selected groups. A CUDA 12.8 PyTorch requirements file is present, but that is not a universal CUDA requirement.

v0.1.4 moves VoxCPM2 AudioVAE encoding to the CPU and uses 64-frame causal decoding chunks to reduce peak VRAM. v0.1.5 adds platform-aware FFmpeg H.264 hardware encoding with a `YOUDUB_VIDEO_ENCODER` override and automatic fallback to `libx264` after partial output is cleaned up. That fallback covers video encoding, not model inference.
```

## Key Capabilities
```text
- Control plane: FastAPI owns the task queue and DAG scheduler, persists state in SQLite WAL, and streams events over `/api/events`.
- Editorial workflow: An `@xyflow/react` graph exposes node settings, human-review pauses, and node-level correction and reruns.
- Translation recovery: OpenAI, Anthropic, and Gemini protocol support, with sliding context and sentence-level checkpoints.
- Voice and timing: VoxCPM2 takes the corresponding source sentence as its voice reference, with optional Qwen forced alignment.
- Resource isolation: Separate Python inference processes allow GPU memory to be reclaimed after heavy stages finish.
- Export resilience: v0.1.5 probes platform H.264 hardware encoders and cleans partial output before retrying with `libx264`.
```

## Quick Start / Clone
```bash
npm --prefix apps/web ci --registry=https://registry.npmmirror.com
npm --prefix apps/desktop ci --registry=https://registry.npmmirror.com
npm run build
npm start
```
