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.1.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.3.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: video_transcriber-0.3.1.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.3.1.tar.gz
Algorithm Hash digest
SHA256 4ebab8927117b5ee628c2c49780d0220c9e9e14683b55db2b3a19cb27df9f2b6
MD5 8481197ae97bc139f9ab8d7515cc7072
BLAKE2b-256 484af119774d096fd46c14bb58f8391a1a6624ab575273085295c07889f65cf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for video_transcriber-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd75ffd31b489fa4cee1a4ddcc4b633d5f4f93316b050ed37dd40d500ff4f0ea
MD5 18c32fd8afa2b223525d619af4801380
BLAKE2b-256 928fa7de575da72a0cf99e106111b0848e5e055adea1a653a4d55a11c9907473

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