Skip to content

feat(video): extract what is on screen, aligned with what was said - #11

Merged
maxgfr merged 1 commit into
mainfrom
issue-7-video-frames
Sep 30, 2026
Merged

maxgfr merged 1 commit into
mainfrom
issue-7-video-frames

Conversation

@maxgfr

@maxgfr maxgfr commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Third of four PRs for #7.

webindex video frames <url|id|dir> [--effort low|med|high]:

  • downloads the video at 720p at most into a temp directory (removed afterwards; one retry after a stray 403);
  • takes a frame at every scene change (select='gt(scene,0.3)',showinfo, timestamps read back from pts_time) and just after every chapter start, and evenly spaced ones for a video with neither;
  • drops near-duplicates by dHash — ffmpeg shrinks every candidate to 9×8 grey in one pass, 64-bit hash, Hamming ≤ 6, no dependency;
  • keeps at most 20 / 50 / 100 frames by --effort (med by default), the most widely spaced first, chapter frames last to go;
  • writes <id>/frames/NNNN_mm-ss.jpg, FRAMES.md (each frame with the transcript from t−5 s to t+10 s, a long passage quoted once) and frames.json.

Library: extractFrames, FRAME_EFFORT.

Checked live on two code tutorials (Fireship "TypeScript in 100 Seconds", "React in 100 Seconds"): the frame at 00:42 shows Cannot find name 'someObject' in the IDE next to "the ide is providing feedback about using a variable that doesn't exist"; the one at 00:51 shows tsc index.ts next to "the tsc command".

webindex video frames takes a frame at every scene change (ffmpeg scene
score above 0.3) and just after every chapter start, evenly spaced ones for
a video with neither, drops near-duplicates by dHash (64 bits, Hamming <= 6,
no dependency: ffmpeg shrinks each frame to 9x8 grey) and keeps at most
20/50/100 by --effort, the most widely spaced first. The frames land in
<id>/frames/NNNN_mm-ss.jpg, and FRAMES.md pairs each with the transcript
from 5 s before it to 10 s after. The video itself lives in a temp
directory removed afterwards.

Refs #7
@maxgfr
maxgfr merged commit 79c46b1 into main Sep 30, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.24.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@maxgfr
maxgfr deleted the issue-7-video-frames branch September 30, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant