CLI for generating and translating SRT subtitles with WhisperX
Project description
Subtatix
Subtatix is a small CLI for generating .srt subtitles from audio or video files with WhisperX, with optional subtitle translation.
It transcribes the input, aligns subtitle timings with WhisperX, and can then translate the resulting subtitle lines into another language.
Requirements
- Python 3.12+
ffmpeginstalled separately and available on yourPATH- Enough disk space for model downloads and caching
The first run will be slower because WhisperX and translation models need to be downloaded. Subsequent runs reuse the cached models and do not need to download them again unless the cache is cleared.
ffmpeg is an external system dependency. It is not installed by pip, uvx, or uv tool install.
Installation
Run without installing:
uvx subtatix --help
Install as a tool with uv:
uv tool install subtatix
Install with pip:
pip install subtatix
Usage
Run the CLI:
subtatix input.mp4
Transcribe to a specific output path:
subtatix input.mp4 --output some-path/some-file-name
--output is a base path, not a full .srt filename. This writes some-path/some-file-name.srt. If you also translate to Spanish, it writes some-path/some-file-name.es.srt.
Set the source language explicitly:
subtatix input.mp4 --source-language en
Translate after transcription:
subtatix input.mp4 --to es
This writes both the original transcription SRT and the translated SRT by default.
If CUDA runs out of memory on larger files, reduce the batch size or force CPU mode:
subtatix input.mp4 --batch-size 4
subtatix input.mp4 --device cpu
To discard the original transcription and only keep the translated output:
subtatix input.mp4 --to es --discard-transcription
Passing an --output value that ends in .srt is rejected. Use a base path such as --output subtitles instead.
List supported language codes:
subtatix --list-languages
subtatix --list-target-languages
Models
By default, transcription uses WhisperX with the Whisper model large-v2. This is a good general default when you want higher transcription quality and aligned subtitle timings, but it is heavier and slower than smaller Whisper models.
Translation uses facebook/nllb-200-1.3B. The CLI accepts simple target codes such as en, es, fr, de, pt, ja, ko, zh, and also raw NLLB codes such as spa_Latn.
Other model options can also be used:
- For transcription, you can pass another Whisper model with
--model, such assmall,medium, orlarge-v3, depending on your speed and accuracy needs. - For translation, the code currently defaults to the NLLB model above, but the translation layer is built around Hugging Face seq2seq models and could be adapted to use a different multilingual translation model if needed.
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 subtatix-0.1.1.tar.gz.
File metadata
- Download URL: subtatix-0.1.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8243169bdfec2bc09b5895af348cf720b6a03a0aab8f1bb2f9c1d20335c15798
|
|
| MD5 |
71a8e96726c5438034b8abb7d1d51908
|
|
| BLAKE2b-256 |
19ce228b0fbe9a64381460d15a86635c5806821a065143cea73c4baa743de072
|
File details
Details for the file subtatix-0.1.1-py3-none-any.whl.
File metadata
- Download URL: subtatix-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beb45204a61bba1b3d9b4748097e0a0f4d3d6e19d6b41e47e48472675d34a8cb
|
|
| MD5 |
9138852717f2be008cc4dd010dc6bfb5
|
|
| BLAKE2b-256 |
bf57f6160d9e1a17404c9a99cf3d36a1a39d7259b3df21c78aec7dce13a1dfc8
|