DEV Community

Jaden Vo
Jaden Vo

Posted on Originally published at infinityme.dev

Free, Offline SRT Subtitles With OpenAI Whisper: A 4-Step CLI Workflow

I make short explainer videos, and for a while I relied on YouTube's auto-captions. They're okay, but they mangle names and tech terms, and I kept wanting a clean transcript I could reuse for descriptions and blog posts. Paid caption tools exist, but there's a free option that runs entirely on your own computer: OpenAI's open-source Whisper model. It writes .srt files directly, so the whole thing is one command.

Here's the workflow I use. The details come from the official Whisper README and its CLI options, checked October 26, 2026.

What you need

  • Python (the README says the code is expected to work with 3.8 to 3.11) and pip
  • ffmpeg, which Whisper uses to read audio and video
  • Enough memory for the model you pick. A GPU speeds things up a lot, but the smaller models are usable on CPU.

Whisper's code and weights are MIT-licensed. You need the internet once, to install it and download a model. After that, transcription is local and your audio never leaves the machine.

Step 1: Install ffmpeg and Whisper

# Ubuntu / Debian
sudo apt update && sudo apt install ffmpeg

# macOS
brew install ffmpeg

# Windows (Chocolatey)
choco install ffmpeg

pip install -U openai-whisper
Enter fullscreen mode Exit fullscreen mode

If the install fails while building tiktoken, the README suggests installing Rust. If you see No module named 'setuptools_rust', run pip install setuptools-rust and try again.

Step 2: Pick a model

This is the only real decision. Official numbers below. "Speed" is relative to large, measured on English speech on an A100, so treat it as a rough guide:

Model Params English-only VRAM Speed
tiny 39 M tiny.en ~1 GB ~10x
base 74 M base.en ~1 GB ~7x
small 244 M small.en ~2 GB ~4x
medium 769 M medium.en ~5 GB ~2x
large 1550 M none ~10 GB 1x
turbo 809 M none ~6 GB ~8x

My rules of thumb:

  • Start with turbo. It's the default, an optimized large-v3, and the accuracy loss is small.
  • English only on an older laptop? Use tiny.en or base.en. The README notes the .en variants do better than their multilingual versions at those sizes.
  • Need translation? Don't use turbo. It isn't trained for translation. Use medium or large.

Step 3: Generate the subtitle file

whisper my-video.mp4 --model turbo --output_format srt --output_dir subs
Enter fullscreen mode Exit fullscreen mode

You can pass the video file directly because ffmpeg handles the decoding. You'll get subs/my-video.srt.

Some flags I use often:

  • --output_format vtt for WebVTT. The default is all, which writes txt, vtt, srt, tsv and json in one go.
  • --language English (or any supported language) skips auto-detection. This helps a lot on short or noisy clips, where detection can guess wrong.
  • --model medium --language Japanese --task translate gives you English subtitles from non-English speech.
  • whisper --help lists the rest.

Before uploading, open the .srt in a text editor and skim it. Whisper is good, but proper nouns, brand names and numbers are where it slips most, and how accurate it is depends on the language and the audio quality. Five minutes of fixes is usually enough.

Step 4: Upload to YouTube

  1. Open YouTube Studio and go to Subtitles.
  2. Pick the video and language.
  3. Choose Upload file, then With timing, and select the .srt.
  4. Preview and publish.

YouTube's help page on supported subtitle files lists both SubRip (.srt) and WebVTT (.vtt), so either output works.

Using it from Python instead

If you'd rather script it (batch jobs, a watch folder, a CI step), the Python API is short:

import whisper

model = whisper.load_model("turbo")
result = model.transcribe("my-video.mp4")
print(result["text"])
Enter fullscreen mode Exit fullscreen mode

The result object also carries segment timings, so you can write your own subtitle format or feed the text into something else. If your machine is too slow, the README links an official Colab notebook. Just remember that Colab runs on Google's servers, so your audio gets uploaded there, which defeats the offline part.

Reusing the transcript

This is the part I didn't expect to like. The .txt output is a full transcript, so the same run gives you:

  • a starting point for the video description
  • a rough draft for a companion blog post
  • a quick way to find the best lines to cut into short clips

For a talking-head or narrated video, that's a lot of extra content from one command you were already running for captions.

Wrap-up

Install ffmpeg and Whisper, start with turbo, export SRT, fix the names, upload. It costs nothing, it runs offline, and you end up with captions that are more accurate than auto-generated ones, plus a transcript you can reuse.

I first wrote this guide on my site, with an FAQ and the model notes: How to Make Free SRT Subtitles for YouTube With OpenAI Whisper.

Top comments (0)