Show HN: YouTube Guitar Tab Parser
Summary
A CLI tool that downloads YouTube guitar lesson videos, uses Claude vision to detect and crop tablature regions, de-duplicates frames by bar number, and stitches them into a PDF. Requires Node.js, yt-dlp, ffmpeg, and an Anthropic API key.
View Cached Full Text
Cached at: 07/13/26, 10:55 PM
marcelpanse/youtube-guitar-tab-parser
Source: https://github.com/marcelpanse/youtube-guitar-tab-parser
Youtube Guitar Tab Parser
CLI that turns a YouTube guitar-lesson video into a PDF of the guitar tab.
It downloads the video, samples frames, uses Claude vision to locate the tab
region, crops every frame to that region, de-duplicates the crops by the bar
number printed on each line of the score, and stitches the distinct tab lines
vertically into a PDF. It works out of the box with no configuration — the PDF
is written to out/<video-title>.pdf, with the video title as a heading on the
first page and in the document metadata.
Requirements
Setup
npm install
npm run build
cp .env.example .env # then put your ANTHROPIC_API_KEY in it
Usage
# with a .env file
node --env-file=.env dist/cli.js "https://www.youtube.com/watch?v=WgU5tDGC-Vc"
# or with the key already exported
export ANTHROPIC_API_KEY=sk-ant-...
node dist/cli.js "https://www.youtube.com/watch?v=WgU5tDGC-Vc"
During development you can skip the build step:
node --env-file=.env --import tsx src/cli.ts "<url>"
The result is written to out/<video-title>.pdf (its path is also printed to
stdout); progress goes to stderr.
Options
Everything has a sensible default; you normally only need the URL.
-i, --interval <seconds> screenshot interval (default 2)
--model <id> Claude vision model (default claude-sonnet-5)
--sample <n> frames sampled for tab-region detection (default 6)
--dedup-threshold <n> pre-dedup Hamming distance, cost control (default 12)
--max-height <px> cap download resolution (default 720)
--keep-temp keep intermediate frames/crops
How it works
- Download —
yt-dlpfetches the video (≤--max-height). - Frames —
ffmpegextracts one frame every--intervalseconds. - Detect — a labeled horizontal-band grid is drawn on
--sampleframes and Claude vision reports which bands contain sheet music. The median first/last music band (robust to an outlier) gives the vertical extent; width is kept full. (Coarse labeled bands are far more reliable than asking a vision model for precise pixel coordinates.) - Crop —
sharpcrops every frame to that region. - Pre-dedup — a dHash perceptual hash drops near-identical consecutive crops. This is only a cost control to reduce the number of vision calls in the next step.
- Bar-number dedup — Claude reads the measure/bar number printed at the start of each line and whether the crop is real sheet music. The tool keeps exactly one crop per distinct bar number (first appearance wins) and drops non-tab crops (title cards, intros/outros). Because the bar number is constant while the playback cursor sweeps a line and only changes when the score advances, this collapses all the near-identical cursor frames of a line into a single page.
- PDF —
pdf-libstacks the distinct tab lines vertically down A4 pages, in the order they appear in the video. The video title (read fromyt-dlp) becomes the file name, a heading on the first page, and the document metadata title. Output:out/<video-title>.pdf.
Similar Articles
Show HN: CPU-only transcription for YouTube, TikTok, X, Instagram videos
yapsnap is a command-line tool for transcribing video/audio from various sources (YouTube, TikTok, etc.) to plain text using only CPU, no GPU or cloud required. It leverages sherpa-onnx and yt-dlp for offline, fast transcription.
@DanKornas: Long YouTube videos can hold useful material, but extracting the key points one transcript at a time does not scale. Yo…
YouTube Summarizer is an open-source Flask web app that summarizes YouTube videos and playlists using Google Gemini or OpenAI models, with caching, audio output, and Docker support.
yt-dlp/yt-dlp
yt-dlp is a feature-rich command-line audio/video downloader supporting thousands of sites, forked from youtube-dl.
Show HN: FableCut – A browser video editor AI agents can drive (zero deps)
FableCut is an open-source, browser-based non-linear video editor that exposes its timeline as a JSON document, allowing AI agents to drive video editing via MCP/REST APIs with live hot-reload.
@RoundtableSpace: 979 VIDEO APIS PACKED INTO ONE MASSIVE GITHUB REPO * Find tools for downloading, transcribing, extracting metadata, sub…
A GitHub repository aggregating 979 video scraping APIs for downloading, transcribing, and extracting metadata from multiple video platforms.