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,cmakeffmpeg(Required for video processing)conda(Anaconda or Miniconda)
Setup
-
Clone and setup Whisper.cpp:
./setup_whisper.sh
-
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
.enmodels (e.g.,base.en) for English-only content.
Documentation
- Usage Examples - CLI and Python API examples
- API Reference - Programmatic API documentation
- Troubleshooting - Common issues and solutions
- Contributing - Contribution guidelines
License
Reference & Credits
Author
Support
For support, email vedgupta@protonmail.com
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce673fb86435d5c6b108d9c442b0a65a1c3e2de066ea5d92067cebcaccc05e41
|
|
| MD5 |
2d65107e0dbb5354b964e8b08f7a1907
|
|
| BLAKE2b-256 |
834a5fa296fd9cde1739e29bf4d9a96a58890dc21a52a284002073c57beb97b9
|
File details
Details for the file subtitle_generator-2.0.0-py3-none-any.whl.
File metadata
- Download URL: subtitle_generator-2.0.0-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdeb027818d00ad7c2adea283bb29a8396de1623f7eec87304bd3d299c04c5df
|
|
| MD5 |
7f0ca031bf180b9f838c0da969e64fd2
|
|
| BLAKE2b-256 |
2b6f0ca64f08c0cd45801f83807011ba71349335ede12469babb80d591409914
|