Problem
AI dubbing services such as ElevenLabs, HeyGen, and Rask AI charge roughly $0.5–$2.5 per minute. For indie creators, educators, and small teams who dub regularly, that puts wider reach out of budget. Using your own OpenAI API key avoids the markup, so cost stays close to the raw API price.
Approach
The input is a video upload or a YouTube URL plus a target language. Seven modules, each with a defined input/output contract:
- Download: save the upload, or fetch with
yt-dlp(also grabbing existing.srtcaptions). - Extract audio with
ffmpeg. - Transcribe: parse the captions if present, otherwise use Whisper. Output is a list of timed segments.
- Translate each segment with GPT, leaving timestamps untouched.
- Synthesize speech per segment with TTS.
- Align and stitch: stretch or compress each clip to its original timing window (
ffmpeg atempo), then join the clips into one track. - Remux the dubbed track into the original video and output an
.mp4.
Results
- Estimated $0.08–$0.13 per 5-minute video in API cost, against $2.50–$12.50 for the same five minutes on commercial tools.
- MVP live on Streamlit (bring your own key), plus local runs with
uvor Docker Compose. - Written PRD, architecture, engineering, and resource-estimate docs ship with the code.
Scope decisions
v1 deliberately limits scope: videos under 5 minutes, a single speaker, a generic TTS voice with no cloning, no lip-sync, and the original background audio replaced. Diarization, voice cloning, and background preservation are planned for later phases.