A high-performance C++ subtitle generator built on whisper.cpp, with automatic GPU acceleration, CPU fallback, multi-format input via FFmpeg, and built-in translation to English.
- π GPU-accelerated with CPU fallback β uses Vulkan/CUDA on Windows/Linux or Metal on macOS automatically when available, with CPU fallback if no compatible GPU is found.
- π― Live subtitle preview β see transcribed text in real-time alongside the progress bar as audio is processed.
- π 100-language transcription + translation β transcribe in the spoken language, or translate into English.
- π Multiple output formats β SRT, WebVTT, ASS, JSON, and plain TXT.
- ποΈ Multi-format input β WAV (built-in), plus MP3/MP4/MKV/FLAC/OGG/AAC/MOV/AVI/WEBM and more via FFmpeg.
- βοΈ Configurable β adjustable chunking, segment merging/splitting, confidence filtering, filler-word removal.
- βΉοΈ Graceful Ctrl+C β stop at any time; subtitles produced so far are still saved.
- π Performance stats β real-time factor, average confidence, average segment length.
Grab the latest binary from the Releases page. Each zip contains:
| Platform | File | GPU backend |
|---|---|---|
| Windows | subtitle_generator-windows-x64.zip |
Vulkan |
| Linux | subtitle_generator-linux-x64.zip |
Vulkan |
| macOS | subtitle_generator-macos-arm64.zip |
Metal |
# 1. Run it β if no models are found, it'll show the list and let you download
./subtitle_generator video.mp4
# After downloading, re-run to start transcription:
./subtitle_generator video.mp4Downloads show live progress from aria2c, curl, or wget. See Model download below. If you hit GPU issues, pass
--cpu. See Troubleshooting.
git clone --recursive https://github.com/SyntX34/SubtitleTool.git
cd SubtitleToolAlready cloned without --recursive?
git submodule update --init --recursiveThe easiest way: just run the tool β if no models are found, it shows the full list and prompts you to type model names to download:
$ subtitle_generator video.mp4
[INFO] No model files found in the 'models/' directory.
Available models:
# Name Size Description
--------------------------------------------------
1 tiny.en 75 MB Fastest, English-only (download)
2 tiny 75 MB Fastest, multilingual (download)
3 base.en 145 MB Default, English-only (download)
...
Enter model name(s) to download (space-separated), or just press Enter
> base.en small
========== Downloading base.en ==========
from: https://huggingface.co/.../ggml-base.en.bin
to : models/ggml-base.en.bin
[#b6c452 145MiB/145MiB(100%) CN:1 DL:11MiB ETA:0s] β live progress!
>> Done! base.en saved to models/
========== Downloading small ==========
...
=========================================================
2 model(s) downloaded successfully!
Re-run the tool to start transcription.
=========================================================
Or use the built-in downloader directly:
# Download a single model
./subtitle_generator --download-model base.en
# Download multiple models at once
./subtitle_generator --download-model base.en small medium
# See all available models
./subtitle_generator --list-modelsOr use the download scripts:
# Linux / macOS
./scripts/download_model.sh base.en
# Windows (PowerShell)
.\scripts\download_model.ps1 -Model base.enAvailable models:
| Model | Size | Description |
|---|---|---|
tiny.en |
~75 MB | Fastest, English-only |
tiny |
~75 MB | Fastest, multilingual |
base.en |
~145 MB | Default, English-only |
base |
~145 MB | Default, multilingual |
small.en |
~465 MB | Good accuracy, English |
small |
~465 MB | Good accuracy, multilingual |
medium.en |
~1.5 GB | High accuracy, English |
medium |
~1.5 GB | High accuracy, multilingual |
large-v3 |
~3.0 GB | Best accuracy, multilingual |
large-v3-turbo |
~1.5 GB | Fast large model, multilingual |
Each model is downloaded into the models/ folder as a .bin file. The tool picks up any .bin file you drop there automatically.
cmake -B build -S .
cmake --build build --config ReleaseThe build result is at build/subtitle_generator (Linux/macOS) or build\Release\subtitle_generator.exe (Windows).
| Option | Default | Description |
|---|---|---|
-DUSE_GPU=ON |
ON | Enable GPU acceleration |
-DFORCE_CPU=ON |
OFF | Force CPU-only build |
-DUSE_FFMPEG=ON |
ON | Enable FFmpeg for multi-format input |
# On Linux/macOS
./build/subtitle_generator audio.mp4 -o subtitles.srt
# On Windows
.\build\Release\subtitle_generator.exe audio.mp4 -o subtitles.srtsubtitle_generator <audio_or_video_file> [OPTIONS]
MODEL
-m, --model <name> Model name, index, or path (default: base.en)
Examples: -m base.en, -m small, -m 1, -m 3
Use by index: -m 1 (see --list-models for numbers)
Or full path: -m models/ggml-base.en.bin
--list-models List all available models with sizes and indices
--download-model Download one or more models and exit
Usage: --download-model <name1> [name2 ...]
Example: --download-model base.en small medium
OUTPUT
-o, --output <path> Output file (default: <input>.<format>)
-f, --format <fmt> srt | vtt | ass | json | txt (default: srt)
--all-formats Save all formats at once
LANGUAGE & TRANSLATION
-l, --lang <code> Source language spoken in the audio (default: auto)
--translate Translate the transcription into English
--list-languages Print every supported language code and exit
PROCESSING
-t, --threads <n> Worker threads (default: 4)
--chunk <secs> Audio chunk size in seconds (default: 30)
--min-conf <0-1> Drop segments below this confidence
--no-filler Remove filler words (um, uh, er, ...)
MISC
-s, --stream Print subtitles live with timestamps
-v, --verbose Verbose whisper output
--cpu, --force-cpu Use CPU only (disable GPU)
--ffmpeg-path <dir> Path to FFmpeg binaries (e.g. D:\FFMPEG\bin)
-h, --help Show this message
# Basic usage β auto-detects model, prompts if none found
subtitle_generator movie.mp4
# After downloading, re-run with the same command:
subtitle_generator movie.mp4 -l en --translate -o subtitles.srt
# Select model by name
subtitle_generator movie.mp4 -m medium
# Select model by index (see --list-models for the list)
subtitle_generator movie.mp4 -m 3
# Download models without transcribing
subtitle_generator --download-model base.en small medium
# Spanish to English subtitles
subtitle_generator pelicula.mp4 -l es --translate
# High accuracy, live stream view, CPU-only
subtitle_generator lecture.mp4 -m medium -s --cpu
# All formats at once, 60-second chunks
subtitle_generator podcast.mkv --all-formats --chunk 60
# Specify FFmpeg path if auto-detection fails
subtitle_generator video.mp4 --ffmpeg-path D:\FFMPEG\bin| Flag | Meaning |
|---|---|
-l <code> |
Language spoken in the audio. Use auto for automatic detection, or set it explicitly for faster/more accurate results. |
--translate |
Translate the transcription into English. |
# Spanish video β English subtitles
subtitle_generator pelicula.mp4 -l es --translate -o english.srt
# Japanese video β Japanese subtitles
subtitle_generator anime.mkv -l ja -o subtitles_ja.srt
# Unknown language β same-language transcript
subtitle_generator interview.wav -l auto -o transcript.srtwhisper.cpp only translates into English. To translate SpanishβFrench, generate English subtitles first then use a text translation tool.
If the program crashes right after detecting your GPU (you see ggml_vulkan: or ggml_cuda: lines and then nothing), use --cpu:
subtitle_generator video.mp4 --cpuThis bypasses the GPU backend entirely and runs on CPU. The GPU-aware build is still used β GPU is just disabled at runtime. Future updates may fix the underlying GPU compatibility issue.
The tool automatically searches common FFmpeg install locations:
- Windows:
D:\FFMPEG\bin,C:\FFmpeg\bin,C:\Program Files\FFmpeg\bin, PATH - Linux:
/usr/lib,/usr/local/lib, ldconfig paths - macOS:
/opt/homebrew/lib,/usr/local/lib
If your FFmpeg is in a non-standard location:
subtitle_generator video.mp4 --ffmpeg-path D:\my\ffmpeg\binWhen built with MSVC, FFmpeg DLLs are loaded lazily (/DELAYLOAD) so the binary can start even without FFmpeg present. Only WAV files work without FFmpeg.
The tool automatically handles model selection:
- No models at all? Shows all downloadable models with sizes, prompts you to type model names to download, shows live download progress, then tells you to re-run to start transcription.
- Single model? Uses it automatically.
- Multiple models? Shows an interactive picker with numbered list.
- Select by index:
-m 1,-m 2, etc. (run--list-modelsto see the numbered list) - Non-downloaded model? Offers to download it, shows progress, then tells you to re-run.
# Auto-resolve model name (no path needed):
subtitle_generator audio.mp4 -m base.en
# Select by index:
subtitle_generator audio.mp4 -m 3
# Download missing models on the fly (without an audio file):
subtitle_generator --download-model small.en medium
# Or specify a full path:
subtitle_generator audio.mp4 -m models/ggml-base.en.bin
# List downloadable models with sizes and indices:
subtitle_generator --list-models
β οΈ Important: When no models are found and you download them, the tool exits with a "Re-run" message instead of auto-continuing. This lets you download multiple models and switch between them freely.
If the models/ directory has .bin files but the one you requested isn't there, the tool will list what it found and prompt you to pick one.
SubtitleTool/
βββ src/
β βββ main.cpp # CLI entry point
β βββ SubtitleGenerator.{hpp,cpp}
β βββ AudioDecoder.{hpp,cpp} # WAV + FFmpeg decoding
β βββ FFmpegHelper.{hpp,cpp} # Runtime FFmpeg detection
β βββ TimestampFormatter.{hpp,cpp}
β βββ dl_windows.cpp # Windows helpers
βββ scripts/
β βββ download_model.sh
β βββ download_model.ps1
βββ third_party/
β βββ whisper.cpp/ # git submodule
βββ .github/workflows/build.yml
βββ CMakeLists.txt
MIT β see LICENSE.
SyntX β github.com/SyntX34