Transcribe videos to ASS subtitle files using faster-whisper
Project description
whispersub
Transcribe video files to ASS subtitle files using faster-whisper (Whisper large-v3-turbo).
- Batch mode: pass multiple files or directories to scan recursively
- 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.
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.
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 — list tracks first, then pick one
whispersub series.mkv # error lists available tracks
whispersub series.mkv --audio-track 2
Options
| Option | Default | Description |
|---|---|---|
--audio-track N |
auto | Audio track index (required if the file has multiple tracks) |
--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.
Each ASS file contains hidden Comment: events carrying word-level timestamp data in JSON, so the raw timing can be recovered by tooling 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.1.0.tar.gz.
File metadata
- Download URL: whispersub-1.1.0.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3292ca70451bfa6da650fb00b7ec55f642df99d632a3f7f47d896292ef89d700
|
|
| MD5 |
787ba4f6437499a94b9e6d48863346cc
|
|
| BLAKE2b-256 |
8d52f91034e07b5b3a8fa329e7c09456f14ea04e66061c920b234b9e60a30893
|
Provenance
The following attestation bundles were made for whispersub-1.1.0.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.1.0.tar.gz -
Subject digest:
3292ca70451bfa6da650fb00b7ec55f642df99d632a3f7f47d896292ef89d700 - Sigstore transparency entry: 1158639372
- Sigstore integration time:
-
Permalink:
zvea/whispersub@cf855662ed5e999eb6b7ce0738b79088e6c8b7a0 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/zvea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cf855662ed5e999eb6b7ce0738b79088e6c8b7a0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file whispersub-1.1.0-py3-none-any.whl.
File metadata
- Download URL: whispersub-1.1.0-py3-none-any.whl
- Upload date:
- Size: 13.4 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 |
7aef45ce2cb9fa279ef24acc002f70f39c37c42dfe67667218c6fbf8d10fe10f
|
|
| MD5 |
2fe0e82519d7eac97b742a5bd77ecebe
|
|
| BLAKE2b-256 |
468ebfddda245875e3d87ea93e95337bd482a0417e278170894976bd42f3e638
|
Provenance
The following attestation bundles were made for whispersub-1.1.0-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.1.0-py3-none-any.whl -
Subject digest:
7aef45ce2cb9fa279ef24acc002f70f39c37c42dfe67667218c6fbf8d10fe10f - Sigstore transparency entry: 1158639450
- Sigstore integration time:
-
Permalink:
zvea/whispersub@cf855662ed5e999eb6b7ce0738b79088e6c8b7a0 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/zvea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cf855662ed5e999eb6b7ce0738b79088e6c8b7a0 -
Trigger Event:
push
-
Statement type: