Extract and transcribe subtitles from videos using multimodal models.
Project description
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
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 exscribe-0.0.1.tar.gz.
File metadata
- Download URL: exscribe-0.0.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5598d0f8806bad3d4bea842071d187d32ce5b7b8978c2db2190b996b3ca4a72b
|
|
| MD5 |
02d72133987c0628cab5417a8c30b21e
|
|
| BLAKE2b-256 |
bab736813c3333c27acbed5a019319004a3beae6749a6303539402840b1b1230
|
Provenance
The following attestation bundles were made for exscribe-0.0.1.tar.gz:
Publisher:
publish.yml on m-krastev/exscribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exscribe-0.0.1.tar.gz -
Subject digest:
5598d0f8806bad3d4bea842071d187d32ce5b7b8978c2db2190b996b3ca4a72b - Sigstore transparency entry: 182409810
- Sigstore integration time:
-
Permalink:
m-krastev/exscribe@708f945ba042c15ec8e7ece35ee63db234dad0c8 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/m-krastev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@708f945ba042c15ec8e7ece35ee63db234dad0c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file exscribe-0.0.1-py3-none-any.whl.
File metadata
- Download URL: exscribe-0.0.1-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa46a431f61c3793ce3643f583cfbd795920c47743ab875b0ef2f25dcf478aac
|
|
| MD5 |
b3fdd1ceb431a0cd2667176cc6a76955
|
|
| BLAKE2b-256 |
8747552d7df5c9e6ff9abd0096333f18aa3a87d5e088052cf06a38c0f4d4226e
|
Provenance
The following attestation bundles were made for exscribe-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on m-krastev/exscribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exscribe-0.0.1-py3-none-any.whl -
Subject digest:
fa46a431f61c3793ce3643f583cfbd795920c47743ab875b0ef2f25dcf478aac - Sigstore transparency entry: 182409813
- Sigstore integration time:
-
Permalink:
m-krastev/exscribe@708f945ba042c15ec8e7ece35ee63db234dad0c8 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/m-krastev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@708f945ba042c15ec8e7ece35ee63db234dad0c8 -
Trigger Event:
push
-
Statement type: