Skip to content

About

Video trancriber

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Video-Analyzer

Video trancriber

Video → Transcript → Key Moments

Takes a long video (a local file, or a YouTube/other URL) and produces:

  • A full timestamped transcript (.txt and .srt)
  • A short overall summary + a chronological list of key moments with timestamps and quotes (.md and .json)

Works well on multi-hour videos because it never asks one model to "watch" the whole thing at once — it transcribes locally with Whisper, then summarizes in 15-minute chunks with Claude, then merges those chunk summaries into one final report.

1. Install prerequisites

ffmpeg (required for audio extraction):

# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Windows: download from ffmpeg.org and add to PATH

Python packages:

cd video_keymoments
python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install -r requirements.txt

Anthropic API key (for the summarization step):

export ANTHROPIC_API_KEY="sk-ant-..."   # get one at console.anthropic.com

2. Run it

Local video file:

python main.py --input "/path/to/lecture.mp4" --out ./output

YouTube (or any yt-dlp-supported) URL:

python main.py --input "https://youtube.com/watch?v=XXXXXXXX" --out ./output

3. Options

Flag Default Notes
--model medium Whisper model size: tiny, base, small, medium, large-v3. Bigger = more accurate but slower. For a 6-7hr video on CPU, start with small or medium; use large-v3 if you have a GPU.
--chunk-minutes 15 How much transcript gets sent to Claude per summarization call. Smaller = more granular key moments but more API calls.
--out ./output Where transcript + report files go.

4. Output files

output/
  transcript.txt      # full plain-text transcript with timestamps
  transcript.srt       # subtitle-format transcript
  key_moments.json     # structured report (video_summary + key_moments[])
  key_moments.md        # human-readable version of the same report

5. Performance notes for a 6-7 hour video

  • Transcription is the slow part. On CPU, medium model runs roughly 2-4x slower than real-time, so a 7-hour video could take several hours. A GPU (even a modest one) speeds this up dramatically — faster-whisper will use CUDA automatically if available (device="auto" in the script). If you're processing videos like this regularly, it's worth running this on a cloud GPU instance rather than a laptop CPU.
  • VAD filtering is already on (vad_filter=True), which skips long silences and can meaningfully cut down processing time for content with dead air (meetings, lectures with pauses, etc).
  • Cost: transcription is local/free (just compute time). The Claude summarization step costs API tokens proportional to transcript length — a 7-hour video chunked into 15-min windows is ~28 chunk-summary calls plus 1 reduce call, which is inexpensive relative to the transcription time.

6. Customizing what counts as "important"

The behavior of what gets flagged as a key moment lives entirely in the prompts in main.py (MAP_SYSTEM_PROMPT and REDUCE_SYSTEM_PROMPT). If your videos are a specific type — sales calls, lectures, podcasts, sports broadcasts — edit those prompts to say what actually matters for that content (e.g. "flag pricing objections and next-step commitments" for sales calls, or "flag definitions and worked examples" for lectures). This is the single highest-leverage thing to tune.

About

Video trancriber

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages