Skip to main content

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+
  • ffmpeg installed separately and available on your PATH
  • 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 as small, medium, or large-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subtatix-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

subtatix-0.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file subtatix-0.1.0.tar.gz.

File metadata

  • Download URL: subtatix-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 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

Hashes for subtatix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b14bbc8c1a5a2f527ffff75b488beaca24dcc46dbf8f8739849763c1ae37990
MD5 9b0b858e52a20ca17306795300ca1905
BLAKE2b-256 f2f96eadf94dd9e0d6a25d49bcf55452989704541d2e80f49751cc6cebdd4a11

See more details on using hashes here.

File details

Details for the file subtatix-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: subtatix-0.1.0-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

Hashes for subtatix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa65000855c989f25c22b4cccd9498019e8c488dba0f4672e407a1225fb3dd26
MD5 b82b4f67e7bb38fb005525364a3427ab
BLAKE2b-256 c9c2f1f22b5ce6a542377ab872b1ae6cd133ebfb524a82bc72ae187729f1ed5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page