Transcribe videos to ASS subtitle files in 99 languages using faster-whisper
Project description
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 |
--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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whispersub-1.3.1.tar.gz.
File metadata
- Download URL: whispersub-1.3.1.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
076bfe5b689440ec2411735bfd15c78ead1826a617f4f7dfbf211cbdf224b299
|
|
| MD5 |
401b9e2e0021630c5c3c723bcb8bedd0
|
|
| BLAKE2b-256 |
e5a6134b4b1f9a7af1600710f925f79f3885aadd13acd0b7d1addc56dd611193
|
Provenance
The following attestation bundles were made for whispersub-1.3.1.tar.gz:
Publisher:
publish.yml on zvea/whispersub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whispersub-1.3.1.tar.gz -
Subject digest:
076bfe5b689440ec2411735bfd15c78ead1826a617f4f7dfbf211cbdf224b299 - Sigstore transparency entry: 1184379721
- Sigstore integration time:
-
Permalink:
zvea/whispersub@afd702f271798f5ea2e24e702914a97de1bd40dc -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/zvea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@afd702f271798f5ea2e24e702914a97de1bd40dc -
Trigger Event:
push
-
Statement type:
File details
Details for the file whispersub-1.3.1-py3-none-any.whl.
File metadata
- Download URL: whispersub-1.3.1-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb8a7080ad205e0e61870742aba6e9135b797e3ac0cfb9fb0015d0bc2fefa809
|
|
| MD5 |
ae9e0351649ecec986dc820683833bd3
|
|
| BLAKE2b-256 |
c3b58562f3d54be0521df722e1728841b8e07ffe3f52cb611312077febb7d79e
|
Provenance
The following attestation bundles were made for whispersub-1.3.1-py3-none-any.whl:
Publisher:
publish.yml on zvea/whispersub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whispersub-1.3.1-py3-none-any.whl -
Subject digest:
bb8a7080ad205e0e61870742aba6e9135b797e3ac0cfb9fb0015d0bc2fefa809 - Sigstore transparency entry: 1184379774
- Sigstore integration time:
-
Permalink:
zvea/whispersub@afd702f271798f5ea2e24e702914a97de1bd40dc -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/zvea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@afd702f271798f5ea2e24e702914a97de1bd40dc -
Trigger Event:
push
-
Statement type: