How go2sun/youtube-auto-dub-m4 works
youtube-auto-dub is a local YouTube video localization tool: a URL is downloaded, transcribed, segmented, translated, optionally dubbed, then rendered with subtitles and a replacement audio track. The graph follows the README’s documented stages and sampled module responsibilities; some orchestration details and unsampled implementations are documented rather than verified in the excerpts.
Main entry points: main.py Pipeline CLI · tts.py Speech Synthesis · youtube.py Video Download · engines.py Whisper ASR
Components 20
Workflow Control
- Pipeline CLI
main.py - Video Download
src/youtube.py - Localized Video
Speech and Translation
- Whisper ASR
src/engines.py - Batch Translation
src/googlev4.py - Speech Synthesis
src/tts.py
Media Processing
- Semantic Chunking
src/media.py - Audio Mixing
src/media.py - SRT Generation
src/media.py - Video Rendering
src/media.py
Runtime Support
- Project Context
src/models.py - Language Map
language_map.json - Terminal Feedback
src/ui.py
Other components
- YouTube User
- YouTube
- Whisper Runtime
- Google Translate
- Edge TTS
- macOS Speech
- FFmpeg
Connections 20
- YouTube User → Pipeline CLI: submits URL
- Pipeline CLI → Video Download: requests download
- Video Download → YouTube: downloads streams
- Video Download → Project Context: creates context
- Project Context → Whisper ASR: provides audio
- Pipeline CLI → Whisper ASR: runs recognition
- Whisper ASR → Whisper Runtime: runs locally
- Pipeline CLI → Semantic Chunking: segments transcript
- Pipeline CLI → Batch Translation: sends segments
- Batch Translation → Google Translate: requests translation
- Pipeline CLI → SRT Generation: generates captions
- Pipeline CLI → Speech Synthesis: requests dubbing
- Speech Synthesis → Edge TTS: synthesizes speech
- Speech Synthesis → macOS Speech: fallback synthesis
- Language Map → Speech Synthesis: maps voice
- Pipeline CLI → Audio Mixing: mixes dubbed audio
- Pipeline CLI → Video Rendering: renders video
- Video Rendering → FFmpeg: encodes and muxes
- Pipeline CLI → Localized Video: produces result
- Pipeline CLI → Terminal Feedback: reports progress