Exscribe 📝
Exscribe extracts and transcribes subtitles from videos using multimodal language models.
Why another subtitle extraction tool you might ask? Traditional OCR tools often struggle with video subtitles due to their size, font, and variable position -- resulting in frequent mis-spellings, missing words, and other errors. Exscribe aims to solve these issues by leveraging AI models for more accurate, coherent, and reliable results.
Features
- Frame extraction and processing from videos
- AI-powered OCR (supports Gemini, OpenAI support planned)
- Subtitle merging and post-processing
- SRT file generation
- Multiple language support
- Debug mode for troubleshooting
Installation
Exscribe is available on PyPI and can be installed via pip:
pip install exscribe
Usage Guide
Exscribe is designed to be simple yet powerful. At its core, you can extract subtitles from any video file with a single command:
exscribe video_file.mp4
This will process your video using default settings (Gemini AI, English language) and create an SRT file with the same name as your input video.
How It Works
- Frame Extraction from video file
- Frame Processing with optional edge detection
- Transcription via AI provider
- Subtitle Generation through merging frames with the same text
- SRT Creation with proper formatting
Configuration Options
Exscribe can be customized to handle different video types, languages, and processing needs:
Language Selection: Specify the language of the subtitles you're extracting with the --language option. This helps the AI model accurately recognize text.
AI Provider: Choose between AI providers with the --provider option. Currently, Gemini is fully supported with OpenAI integration planned.
Performance Tuning: Adjust how Exscribe processes videos with options like:
--batch_sizeto control memory usage and processing speed--frame_skipto reduce processing time by analyzing fewer frames--similarity_thresholdto fine-tune frame comparison sensitivity
Troubleshooting: Enable --debug mode to save intermediate files which can help diagnose issues or improve results.
API Key Management
Exscribe requires API keys for the AI providers. You can provide them in two ways:
# Method 1: Command line arguments
exscribe video.mp4 --gemini_api_key YOUR_KEY
# Method 2: Environment variables (recommended for security)
export GEMINI_API_KEY=your_api_key
export OPENAI_API_KEY=your_api_key
Comparison with Alternatives
| Feature | Exscribe | Traditional OCR | Subtitle Editors |
|---|---|---|---|
| High accuracy with stylized fonts | ✅ | ❌ | ❌ |
| Context-aware text recognition | ✅ | ❌ | ✅ |
| Wide language support | ✅ ✅ | ⚠️ | ✅ |
| Effective with burned-in subtitles | ✅ | ⚠️ | ❌ |
| Special character recognition | ✅ | ❌ | ✅ |
| Intelligent subtitle merging | ✅ | ❌ | ⚠️ |
| Fully automated processing | ✅ | ⚠️ | ❌ |
| Simple setup | ✅ | ❌ | ✅ |
| No API costs | ⚠️* | ✅ | ✅ |
| Works without internet | ❌ | ✅ | ✅ |
| Fast processing | ⚠️ | ✅ ✅ | ❌ |
✅ = Fully supported | ⚠️ = Partially supported | ❌ = Not supported
*Free quotas available for Gemini AI, OpenAI requires billing account.
Practical Examples
Basic Processing:
# Process a single video with default settings
exscribe video.mp4
Batch Processing:
# Process all videos in a directory
exscribe /path/to/videos/
Advanced Configuration:
# Extract English subtitles with custom processing settings
exscribe documentary.mp4 --language English --batch_size 32 --frame_skip 15
Testing New Providers:
# Try OpenAI with debug mode for troubleshooting
exscribe video.mp4 --provider openai --debug
Keeping only unique structurally similar frames:
# For videos with hard-to-read subtitles
exscribe difficult_video.mp4 --edge_detection --similarity_threshold 0.1
Metadata
Release files for exscribe 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| exscribe-0.0.1.tar.gz | 12.2 kB | With provenance | Details for exscribe-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| exscribe-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for exscribe-0.0.1-py3-none-any.whl |
Total release size: 25.8 kB
Release files / exscribe-0.0.1.tar.gz
| Download URL | exscribe-0.0.1.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5598d0f8806bad3d4bea842071d187d32ce5b7b8978c2db2190b996b3ca4a72b
|
|
BLAKE2b-256 checksum How to use checksums |
bab736813c3333c27acbed5a019319004a3beae6749a6303539402840b1b1230
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 14, 2025.
Transparency logRelease files / exscribe-0.0.1-py3-none-any.whl
| Download URL | exscribe-0.0.1-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa46a431f61c3793ce3643f583cfbd795920c47743ab875b0ef2f25dcf478aac
|
|
BLAKE2b-256 checksum How to use checksums |
8747552d7df5c9e6ff9abd0096333f18aa3a87d5e088052cf06a38c0f4d4226e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 14, 2025.
Transparency logSecurity for exscribe 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for exscribe-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 14, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.