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

Installation

# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate

# Install the package
pip install -e .

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. To get faster downloads and higher rate limits, you can set up a free Hugging Face token before the installation:

  1. Create an account at https://huggingface.co
  2. Go to Settings → Access Tokens → Create new token (read access is sufficient)
  3. Set the environment variable:
export HF_TOKEN=your_token_here

To make it permanent, add that line to ~/.bashrc or ~/.profile.

Usage

Quick Demo

Run the demo script to process the included test video:

source venv/bin/activate
python demo_create_zip.py

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

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)
)

Development

pip install -e .[test]
pytest
#  pytest --cov=video_transcriber if you want coverage (currently 89%)

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.2.0.tar.gz (14.4 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.2.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: video_transcriber-0.2.0.tar.gz
  • Upload date:
  • Size: 14.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 272adc4f0fa1a51664664087301e2ba071446c9339898c8f081225a97c905ca2
MD5 44078c3be22837f0bd46a1428f27fc53
BLAKE2b-256 4e1acba8dbc2f86ca1d23e86bfc89dddff0f3e3822cf1bab115a70d7cd64f22d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for video_transcriber-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c659481ccdb0302f5468a2212a769d1b9ff63152c71e3753762868459b299781
MD5 55a7052566962fc630f36b8756944f37
BLAKE2b-256 ea01fe29be44842d0a0041670ec7c10ae2a6fadadf7eb305e9303d4014155417

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