HeadlinesBriefing favicon HeadlinesBriefing.com

GitHub CLI Converts YouTube Guitar Lessons to PDF Tabs

Hacker News •
×

marcelpanse created a CLI that turns a YouTube guitar-lesson video into a PDF of the guitar tab. The tool downloads the video via yt-dlp, samples frames with ffmpeg, and uses Claude vision to locate the tab region. It crops every frame to that region, de-duplicates crops by the bar number printed on each score line, and stitches distinct tab lines vertically into a multi-page PDF.

The pipeline works out of the box: the PDF is written to out/<video-title>.pdf with the video title as a heading and in metadata. Requirements are Node.js ≥ 20, yt-dlp and ffmpeg on PATH, and an Anthropic API key. Usage is a single command after `npm install` and `npm run build`.

Detection uses a labeled horizontal-band grid on sampled frames; Claude vision reports which bands contain sheet music. The median first/last music band gives the vertical crop extent. A perceptual hash pre-dedup reduces vision calls, then Claude reads bar numbers to keep exactly one crop per distinct measure, collapsing cursor-sweep frames. Finally, pdf-lib stacks lines down A4 pages in video order.