sameem.dev

Started Updated

TranscribeTool

Turn a YouTube link, video or audio file into text.

  • Python
  • Streamlit
  • Whisper
  • FFmpeg
  • yt-dlp
TranscribeTool in a dark theme, with a file upload box, a YouTube link pasted into the URL field, and the transcribed text of the video below
transcribetool.streamlit.appsameemul-haque/TranscribeTool

Built for my brother

One day my brother asked me if there was a tool that could get the transcript of a YouTube video.

There were tools, but most of them were full of ads, wanted a sign-up, or only worked on videos that already had captions. So I built one for him, and kept it as simple as possible: paste a link, wait a moment, read the text.

It took about a week, from March 6 to 13, 2024.

How it works

There are two ways in:

  • Paste a YouTube link. yt-dlp downloads only the audio.
  • Upload a video or audio file. FFmpeg pulls out the audio track and converts it to FLAC.

The audio then goes to OpenAI’s Whisper speech recognition model. Whisper sends back the text, which is shown on the page, ready to copy.

The interface is built with Streamlit, which let me write the whole app in one Python file. I hid Streamlit’s default header and toolbar and gave it a Catppuccin-style dark theme, so it feels like a small tool rather than a dashboard.

Local Whisper to the Hugging Face API

The first version ran Whisper inside the app itself. That’s fine on my laptop, but heavy for a free Streamlit Community Cloud app. So I switched to the whisper-base.en model through the Hugging Face Inference API. The app sends the audio and gets the text back, and when the model is still loading, it asks you to try again in a minute.

The trade-off is that base.en only understands English, and it’s the smaller model, so it’s less accurate than the bigger Whisper models. For what my brother needed, it was good enough.

A small name change

It started out as VideoTool, because it only handled videos. Once it could take audio files and YouTube links as well, the name didn’t fit anymore, so it became TranscribeTool.