Video Translator
experimentA local AI dubbing pipeline that transcribes a video's audio, translates it, and re-synthesizes speech in the target language using open-source models.
tech = [Python, OpenAI Whisper, FFmpeg, demucs]

I always wanted to watch Japanese anime and other foreign-language films in English without living in the subtitles. During a break I decided to see how far open-source models could get me, and built a script that:
- Extracts the background audio from the video.
- Transcribes it to a subtitle file in the original language.
- Translates each subtitle to English.
- Converts the translated subtitles to audio.
- Merges the translated audio with the background track.
- Muxes the final audio back into the video.
I wanted to lean on open-source tooling and minimize paid services:
- OpenAI Whisper
— transcription. The
turbomodel worked better thanlargefor my clips. - FFmpeg — all the audio/video muxing.
- demucs — vocal/background separation.
- srt — reading/writing subtitle files.
- ChatGPT / Google Translate API — translation, with an option to pick between them (Google is more literal; ChatGPT adds a human touch).
What was actually hard
- Transcription with loud background music. Separating vocals with demucs didn’t help much in my cases — Whisper was trained on messy audio and did better on the raw track.
- Translation quality vs. tone. Google Translate was the most accurate; ChatGPT read more naturally. The script lets you choose.
- Open-source TTS quality. Bark produced distorted output on some lines. I moved to voice cloning with OpenVoice + MeloTTS — which became its own project, Audio Cloning .
- Audio length drift. Translated speech is often longer than the original, which breaks the mux. Some lines need trimming.
- Apple M1. The libraries assume CUDA; running on CPU was slow and needed OpenVoice patched to not require a GPU.
The repo README has the full run instructions.