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).

Try it without installing

With uv, you can run it once without installing anything permanently:

uvx --from autosubs-whisper autosubs VIDEO [VIDEO ...]

uvx fetches the package into a temporary environment, runs the autosubs command, and leaves nothing behind. (The --from flag is needed because the package is named autosubs-whisper (autosubs was already taken) while the command is autosubs.)

Install

uv tool install autosubs-whisper

This puts the autosubs command on your PATH (works on macOS, Linux, and Windows). pipx install autosubs-whisper works too.

For local development from a clone, use uv sync and uv run autosubs.

Usage

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
autosubs talk.mp4

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

# Force source language, write into a separate folder, regenerate existing
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.1.tar.gz (78.3 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.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autosubs_whisper-0.1.1.tar.gz
  • Upload date:
  • Size: 78.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for autosubs_whisper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e9045703795c4590c1ec6a26dad7cfbebd5568cd83877844957cf7f5d0d9e50d
MD5 c44f4233a9b40e9653eb768195a59794
BLAKE2b-256 72c9bb81e70b6db1cd6629576aaa5e8c0613d01e576cba9d0b09927aed1c4bd6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: autosubs_whisper-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for autosubs_whisper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc77113ec05985264f98efc35c4a9ceba303d100e236b85ae2c5ccc6a1027702
MD5 60ebf8a5f402d92282a347da91032643
BLAKE2b-256 00881965042ac6530c34b1b5cf787d6a725f838114b075a98692f52cccbd1785

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