Skip to main content

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

  1. Frame Extraction from video file
  2. Frame Processing with optional edge detection
  3. Transcription via AI provider
  4. Subtitle Generation through merging frames with the same text
  5. 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_size to control memory usage and processing speed
  • --frame_skip to reduce processing time by analyzing fewer frames
  • --similarity_threshold to 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exscribe-0.0.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

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

exscribe-0.0.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

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

Hashes for exscribe-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5598d0f8806bad3d4bea842071d187d32ce5b7b8978c2db2190b996b3ca4a72b
MD5 02d72133987c0628cab5417a8c30b21e
BLAKE2b-256 bab736813c3333c27acbed5a019319004a3beae6749a6303539402840b1b1230

See more details on using hashes here.

Provenance

The following attestation bundles were made for exscribe-0.0.1.tar.gz:

Publisher: publish.yml on m-krastev/exscribe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for exscribe-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa46a431f61c3793ce3643f583cfbd795920c47743ab875b0ef2f25dcf478aac
MD5 b3fdd1ceb431a0cd2667176cc6a76955
BLAKE2b-256 8747552d7df5c9e6ff9abd0096333f18aa3a87d5e088052cf06a38c0f4d4226e

See more details on using hashes here.

Provenance

The following attestation bundles were made for exscribe-0.0.1-py3-none-any.whl:

Publisher: publish.yml on m-krastev/exscribe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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