Skip to main content

Open-source subtitle generation for seamless content translation.

Project description

Subtitle

Open-source subtitle generation for seamless content translation.

Key Features:

  • Open-source - Freely available for use, modification, and distribution
  • Self-hosted - Run on your own servers for enhanced control and privacy
  • AI-powered - Leverage Whisper for accurate, natural-sounding subtitles
  • Multilingual - Generate subtitles in a wide range of languages
  • Fast - Uses whisper.cpp for high-performance inference

Installation

Prerequisites

Ensure you have the following installed:

  • git, make, cmake
  • ffmpeg (Required for video processing)
  • conda (Anaconda or Miniconda)

Setup

  1. Clone and setup Whisper.cpp:

    ./setup_whisper.sh
    
  2. Create and activate conda environment:

    conda env create -f environment.yml
    conda activate subtitle
    

Usage

Generate Subtitles

# Basic usage (generates VTT subtitle file)
python subtitle.py video.mp4

# Generate and embed subtitles into video
python subtitle.py video.mp4 --merge

# Use a specific model
python subtitle.py video.mp4 --model base

# Generate SRT format
python subtitle.py video.mp4 --format srt

# From URL
python subtitle.py "https://example.com/video.mp4"

Model Management

# List all available models
python subtitle.py models --list

# Download a specific model
python subtitle.py models --download large

View Supported Formats

python subtitle.py formats

Options

Option Description
--model, -m Model to use (default: base)
--format, -f Output format: vtt, srt, txt, json, lrc (default: vtt)
--merge Embed subtitles into video
--threads, -t Number of threads (default: 4)
--verbose, -v Verbose output

Available Models

Model Size Speed Best For
tiny ~75MB Fastest Quick previews
base ~140MB Fast General use (default)
small ~460MB Medium Quality output
medium ~1.5GB Slow Professional work
large ~3GB Slowest Maximum accuracy

Tip: Use .en models (e.g., base.en) for English-only content.

Documentation

License

MIT

Reference & Credits

Author

Support

For support, email vedgupta@protonmail.com

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

subtitle_generator-2.0.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

subtitle_generator-2.0.0-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file subtitle_generator-2.0.0.tar.gz.

File metadata

  • Download URL: subtitle_generator-2.0.0.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for subtitle_generator-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ce673fb86435d5c6b108d9c442b0a65a1c3e2de066ea5d92067cebcaccc05e41
MD5 2d65107e0dbb5354b964e8b08f7a1907
BLAKE2b-256 834a5fa296fd9cde1739e29bf4d9a96a58890dc21a52a284002073c57beb97b9

See more details on using hashes here.

File details

Details for the file subtitle_generator-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for subtitle_generator-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdeb027818d00ad7c2adea283bb29a8396de1623f7eec87304bd3d299c04c5df
MD5 7f0ca031bf180b9f838c0da969e64fd2
BLAKE2b-256 2b6f0ca64f08c0cd45801f83807011ba71349335ede12469babb80d591409914

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