Skip to main content

Automatic subtitle (.srt) generator CLI using local Whisper speech-to-text

Project description

autosubs

Automatic subtitle (.srt) generator CLI. Point it at video/audio files (or directories) and it writes a sidecar .srt subtitle file per input using a local faster-whisper speech-to-text model. Runs fully offline after the first model download.

Features:

  • Automatic spoken-language detection.
  • Translate-to-English mode (--translate).
  • Batch / recursive directory input.
  • Cross-platform: CPU int8 on macOS (Apple Silicon), CUDA on Linux/NVIDIA (untested but should work).

Install (using uv)

uv sync

Usage

uv run autosubs VIDEO [VIDEO ...]

The first run downloads the chosen Whisper model from the Hugging Face Hub (needs internet once); subsequent runs are offline.

Examples:

# Transcribe one file -> creates video.srt beside it
uv run autosubs talk.mp4

# Recurse a directory, English translation, larger model
uv run autosubs ./season1/ --translate --model large-v3

# Force source language, write into a separate folder, regenerate existing
uv run autosubs clip.mkv --language ja --output-dir ./subs --overwrite

Options

Flag Default Description
--model small Whisper size/name: tiny, base, small, medium, large-v3, large-v3-turbo, distil-large-v3. Use large-v3 when a CUDA GPU is available.
--translate off Translate speech to English (Whisper task=translate).
--language auto Force source language ISO code (en, ja, ...). Omit to auto-detect.
--device auto auto (CUDA if available, else CPU), cpu, or cuda.
--compute-type int8 CTranslate2 compute type (int8, int8_float16, float16).
--beam-size 5 Beam search width.
--output-dir beside input Directory for .srt files.
--overwrite off Regenerate .srt files that already exist (default: skip).

By default, inputs whose target .srt already exists are skipped; pass --overwrite to regenerate.

Notes

  • Audio is decoded directly from video containers via PyAV (bundled with faster-whisper), so system FFmpeg is not required. If installed, ffmpeg is used as a fallback for exotic codecs PyAV cannot open.
  • On macOS only the CPU backend is available (no Metal GPU support in CTranslate2); int8 keeps it reasonably fast.

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

autosubs_whisper-0.1.0.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

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

autosubs_whisper-0.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autosubs_whisper-0.1.0.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for autosubs_whisper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac445a0904dd41648b755295383ac3e01b16d5c47d7ab59db689568b0a904abb
MD5 21125c38a11c0070f9afd8c8b4430721
BLAKE2b-256 e4f31ed50cf3bccc38dd45e0203102af5bedd8516cce21d138be7b0ed0ad27e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for autosubs_whisper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2963b686a6e78f125289871cfed5cd016e6080205c65102a5ec1d06616a76fe8
MD5 6f3653470d8ca085dd1544eef0899e3d
BLAKE2b-256 cbcba9b3196e95f52c7d88ebc1448a854b082dd6ce60f6f26752ec115795c5ae

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