Extract timed text transcripts and single-frame screenshots from tutorial video directories, for use in AI-assisted markdown note writing. Targeted at STM32 / embedded tutorial collections, but intentionally collection-agnostic.
parse — Extract timed text from subtitle filespython tools/extract.py parse <input> [--outdir <dir>]
.mp4 file, or a directory containing .mp4
files (scans recursively)../transcripts/.Output structure (mirrors input directory layout):
<outdir>/
└── transcripts/
└── <collection-name>/
└── <video-name>.txt
Each .txt file contains lines of:
[HH:MM:SS.mmm] <subtitle text>
frame — Extract a single frame as JPEGpython tools/extract.py frame <video> <timestamp> --outpath <path>
.mp4 file.HH:MM:SS or SSS (seconds).For each .mp4, find the best-matching subtitle file:
.srt, excluding _英文.srt / _English.srt..ass (parse [Events] → Dialogue lines, strip ASS
override tags like {\\fn...}).parse)ffmpeg / ffprobe on PATH (only for frame).txt files are consumed by a human or
AI note-writer.python tools/extract.py parse <collection-dir> --outdir ./transcripts.txt files → decide which timestamps need screenshots.python tools/extract.py frame <video> <ts> --outpath <notes>/assets/<name>.jpg