Why I built VidSub
See, I’m a very big fan of watching anime and donghua (Chinese anime). I ran
into a few episodes that didn’t have subtitles, and after searching everywhere
without finding them, I started looking for a tool that could add subtitles to
a video.
I found a few options, but they asked me to buy credits. That’s understandable:
running AI services takes resources and can get expensive. But I didn’t want to
spend $3–$4 just to subtitle one or two videos, so I decided to build something
for myself.
The idea was to keep the setup simple and avoid paying for video storage or
building my own AI models. VidSub uses my Google Drive to store uploaded videos,
AssemblyAI to transcribe the audio, Gemini to translate the transcript, and
FFmpeg to prepare the audio and add the translated subtitles to the video. The
result is an MP4 with soft subtitles.
Getting the transcription right was the part that took the most time. The
important bit was getting usable timestamps along with the translated text, so
the subtitles would show up at roughly the right moments. I worked on the
prompt and processing flow, tested it, and eventually got a system that works
well for me.
A quick disclaimer: in my experience, the subtitles are roughly 95% in sync,
but that’s just my estimate—not a guarantee. They’re useful, but they’re not
perfect, and the translation can get things wrong. I know a little Japanese and
Chinese, so I can follow a lot of what’s being said; for me, the subtitles are
mostly for peace of mind and a little extra help with words I miss.
You can check out the code, run VidSub locally, add your own ideas, customize
it to suit you, and give it a try here:
https://github.com/querysmith-sys/vidsub
One more thing: you’ll need to configure your own Google Drive, AssemblyAI, and
Gemini credentials. Their services may have usage limits or charges, so check
their current terms before using them.
Top comments (0)