Skip to main content

A Python project following TDD principles

Project description

video-transcriber

Extracts visually distinct frames from videos and transcribes audio using Whisper. Creates a portable zip file containing a markdown transcript with slide images in the img sub-directory.

Features

  • Smart slide detection - Uses perceptual hashing to capture only distinct frames, not every frame
  • Audio transcription - Uses Whisper AI locally to transcribe speech to text
  • Timeline merging - Associates transcribed audio with the corresponding slides
  • Portable output - Generates a zip file with markdown and images that works anywhere

Requirements

  • Python 3.10+
  • ffmpeg (for audio extraction)
# Ubuntu/Debian
apt install ffmpeg

# macOS
brew install ffmpeg

# Windows (using winget)
winget install ffmpeg

Installation

uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install video-transcriber

Hugging Face

The first time you run the transcriber, it downloads Whisper models from Hugging Face. This may take several minutes.

You may see this warning:

Warning: You are sending unauthenticated requests to the HF Hub.

This is harmless. Everything will still work.

Usage

Python API

from video_transcriber.transcribe import transcribe_video

zip_path = transcribe_video("my-presentation.mp4", "output/")

The output zip file contains:

output/my-presentation_transcript.zip
├── transcript.md
└── img/
    ├── frame_000.png
    ├── frame_001.png
    └── ...

Options

zip_path = transcribe_video(
    "my-presentation.mp4",
    "output/",
    model_size="large-v3",     # Whisper model: tiny, base, small, medium, large-v3
    sample_interval=15,        # Check for new slides every N frames (default: 30)
    include_timestamps=True,   # Include timestamps in markdown output (default: False)
    audio_only=False           # Transcribe audio only, skip frame extraction (default: False)
)

Audio-Only Mode

For videos where you only need the audio transcript (podcasts, interviews, etc.):

zip_path = transcribe_video(
    "podcast.mp4",
    "output/",
    audio_only=True,
    include_timestamps=True
)

This skips frame extraction entirely, producing a zip with just the text transcript.

Development

git clone https://github.com/romilly/video-transcriber.git
cd video-transcriber
python -m venv venv
source venv/bin/activate
pip install -e .[test]
pytest

Quick Demo

Run the demo script to process the included test video:

python demo_create_zip.py

This processes tests/data/demo.mp4 and creates tests/data/generated/demo.zip.

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

video_transcriber-0.3.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

video_transcriber-0.3-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file video_transcriber-0.3.tar.gz.

File metadata

  • Download URL: video_transcriber-0.3.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for video_transcriber-0.3.tar.gz
Algorithm Hash digest
SHA256 84d94fbdfd934f75486023db48d0425033affa9b966f1de17b99bceac1e49ef7
MD5 0603234a36c952dfa95b7bddb1a8d536
BLAKE2b-256 87d832f8a1702a5ce0304b4ab74325bec7687156e35348926a02588e77499567

See more details on using hashes here.

File details

Details for the file video_transcriber-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for video_transcriber-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 948aceb0a0190b83fe67c16aa02649e917341baa9b007bc657ac6d4cbfa2e7dd
MD5 889806579a979a1618fea4ac4f0d36e6
BLAKE2b-256 3249ddc8934547550133663405a8ec3de08e55eaefc44eda5104553c12a9f18e

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