whispersub
Transcribe video files to ASS subtitle files using faster-whisper. Whisper detects the spoken language automatically and supports 99 languages, including English, Spanish, French, German, Japanese, Chinese, Arabic, Hindi, and many more.
- NVIDIA GPU acceleration with automatic CPU fallback
- Batch mode: pass multiple video files or directory trees
- Surround-sound audio extraction (dialogue-channel aware)
- Word-level timestamps with balanced line breaking
- Per-word confidence colour coding in the terminal
Requirements
Python 3.10+. Works on Linux, Windows, and macOS. No system FFmpeg needed — PyAV bundles its own. Supports MKV, MP4, AVI, MOV, WebM, TS, and other common video formats.
Install
pip install whispersub
GPU acceleration (Linux/Windows — requires an NVIDIA GPU with CUDA 12):
pip install whispersub[gpu]
Without [gpu], whispersub falls back to CPU automatically if CUDA is unavailable.
On first run, whispersub downloads the Whisper large-v3-turbo model (~800 MB) from Hugging Face and caches it locally.
Usage
# Single file — writes movie.en.ass alongside the video
whispersub movie.mkv
# Explicit output directory
whispersub movie.mkv --output-dir ~/subs
# Whole directory, force overwrite
whispersub /media/shows --force
# File with multiple audio tracks — inspect, then pick one
whispersub series.mkv --list-audio-tracks
whispersub series.mkv --audio-track 2
Options
| Option | Default | Description |
|---|---|---|
--audio-track N |
— | Audio track index (required if the file has multiple tracks) |
--list-audio-tracks |
off | Show audio tracks for all input videos, grouped by configuration, and exit |
--colour-by |
probability |
Per-word terminal colour coding: probability or duration |
--font-size N |
48 |
Font size (1280×720 canvas; player scales to actual resolution) |
--force |
off | Overwrite existing subtitle files (keeps backups) |
--keep N |
3 |
Number of .bak copies to keep when overwriting |
--limit N |
— | Stop after N segments per video (useful for testing) |
--max-line-count N |
2 |
Maximum subtitle lines per card |
--max-line-width N |
36 |
Maximum characters per line |
--max-threads N |
all cores | CPU thread limit |
--output-dir DIR |
alongside video | Write all subtitle files to this directory |
Output
Subtitle files are named <stem>.<language>.ass, e.g. movie.en.ass. The detected language comes from Whisper. Output is compatible with VLC, mpv, IINA, MPC-HC, and other players that support ASS/SSA subtitles.
We chose ASS over SRT for better-looking subtitles: font sizing scales correctly to any resolution, and line breaks are balanced for readability. It also allows us to preserve word-level timing, so the file can be post-processed or reformatted without re-transcribing.
Licence
MIT
Metadata
Release files for whispersub 1.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| whispersub-1.5.1.tar.gz | 35.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| whispersub-1.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.5 kB
Release files / whispersub-1.5.1.tar.gz
| Download URL | whispersub-1.5.1.tar.gz |
|---|---|
| Size | 35.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95283a56fd9609a372166add7bce6d086a68424c8700a5d9caebe7d437554e8c
|
|
BLAKE2b-256 checksum How to use checksums |
fca1c10b6b7c51972a9d6ec3ab2b08a31173e325ea16ce2b75b4ffa558362665
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.
Transparency logRelease files / whispersub-1.5.1-py3-none-any.whl
| Download URL | whispersub-1.5.1-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2988c4fdd86e83997b5fd0f72017dd54b51dd5e9a805de84b6212bcef2c01fec
|
|
BLAKE2b-256 checksum How to use checksums |
164eda4b937d2a78330e6eb2fab4d87a7bb08f21a5455c9ed0ff8f54a76d950b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.
Transparency log