[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-93275":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":13,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":14,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":19,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},93275,"youtube-guitar-tab-parser","marcelpanse\u002Fyoutube-guitar-tab-parser","marcelpanse","CLI that turns a YouTube guitar-lesson video into a PDF of the guitar tab.","",null,"TypeScript",156,5,1,0,17,52.53,"GNU General Public License v3.0",false,"main",[22,23,24],"guitar","tabs","transcribe","2026-07-22 04:02:08","# Youtube Guitar Tab Parser\n\nCLI that turns a YouTube guitar-lesson video into a PDF of the guitar tab.\n\nIt downloads the video, samples frames, uses Claude vision to locate the tab\nregion, crops every frame to that region, de-duplicates the crops by the bar\nnumber printed on each line of the score, and stitches the distinct tab lines\nvertically into a PDF. It works out of the box with no configuration — the PDF\nis written to `out\u002F\u003Cvideo-title>.pdf`, with the video title as a heading on the\nfirst page and in the document metadata.\n\n## Example\n\nGenerated from the YouTube lesson\n[Game of Thrones - Guitar Lesson + TAB](https:\u002F\u002Fyoutu.be\u002FWgU5tDGC-Vc):\n\n- 🎬 Source video: \u003Chttps:\u002F\u002Fyoutu.be\u002FWgU5tDGC-Vc>\n- 📄 Output PDF: [examples\u002FGame of Thrones.pdf](examples\u002FGame%20of%20Thrones.pdf)\n\n## Requirements\n\n- Node.js ≥ 20\n- [`yt-dlp`](https:\u002F\u002Fgithub.com\u002Fyt-dlp\u002Fyt-dlp) and [`ffmpeg`](https:\u002F\u002Fffmpeg.org\u002F) on your `PATH`\n  (`brew install yt-dlp ffmpeg`)\n- An Anthropic API key\n\n## Setup\n\n```bash\nnpm install\nnpm run build\ncp .env.example .env   # then put your ANTHROPIC_API_KEY in it\n```\n\n## Usage\n\n```bash\n# with a .env file\nnode --env-file=.env dist\u002Fcli.js \"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=WgU5tDGC-Vc\"\n\n# or with the key already exported\nexport ANTHROPIC_API_KEY=sk-ant-...\nnode dist\u002Fcli.js \"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=WgU5tDGC-Vc\"\n```\n\nDuring development you can skip the build step:\n\n```bash\nnode --env-file=.env --import tsx src\u002Fcli.ts \"\u003Curl>\"\n```\n\nThe result is written to `out\u002F\u003Cvideo-title>.pdf` (its path is also printed to\nstdout); progress goes to stderr.\n\n## Options\n\nEverything has a sensible default; you normally only need the URL.\n\n```\n-i, --interval \u003Cseconds>   screenshot interval (default 2)\n--model \u003Cid>               Claude vision model (default claude-sonnet-5)\n--sample \u003Cn>               frames sampled for tab-region detection (default 6)\n--dedup-threshold \u003Cn>      pre-dedup Hamming distance, cost control (default 12)\n--max-height \u003Cpx>          cap download resolution (default 720)\n--keep-temp                keep intermediate frames\u002Fcrops\n```\n\n## How it works\n\n1. **Download** — `yt-dlp` fetches the video (≤ `--max-height`).\n2. **Frames** — `ffmpeg` extracts one frame every `--interval` seconds.\n3. **Detect** — two stages, since vision models are reliable at picking labeled\n   regions but not at precise pixel coordinates:\n   - A labeled row\u002Fcolumn grid is drawn on `--sample` frames and Claude vision\n     reports which rows and columns the sheet music overlaps. The per-edge median\n     across samples gives a coarse box (works whether the tab is a full-width\n     bottom strip or a corner overlay).\n   - That box is then snapped to the actual paper edges with an image mask\n     (sheet music is dark content on a light, unsaturated background, unlike the\n     colourful performer\u002Fbackdrop), so the crop hugs the tab tightly. If no clear\n     paper region is found (e.g. a dark-themed tab viewer), the vision box is used.\n4. **Crop** — `sharp` crops every frame to that box.\n5. **Pre-dedup** — a dHash perceptual hash drops near-identical consecutive crops.\n   This is only a cost control to reduce the number of vision calls in the next step.\n6. **Bar-number dedup** — Claude reads the measure\u002Fbar number printed at the start\n   of each line and whether the crop is real sheet music. The tool keeps exactly\n   one crop per distinct bar number (first appearance wins) and drops non-tab\n   crops (title cards, intros\u002Foutros). Because the bar number is constant while\n   the playback cursor sweeps a line and only changes when the score advances,\n   this collapses all the near-identical cursor frames of a line into a single page.\n7. **PDF** — `pdf-lib` stacks the distinct tab lines vertically down A4 pages,\n   in the order they appear in the video. The video title (read from `yt-dlp`)\n   becomes the file name, a heading on the first page, and the document metadata\n   title. Output: `out\u002F\u003Cvideo-title>.pdf`.\n","这是一个将YouTube吉他教学视频自动提取并生成标准PDF格式吉他谱（tab）的命令行工具。它通过下载视频、按时间间隔采样帧画面，利用Claude视觉模型定位乐谱区域，结合图像处理技术精准裁剪并去重（基于谱表上的小节编号），最终垂直拼接为可打印的PDF文件。项目采用TypeScript开发，依赖yt-dlp、ffmpeg和Anthropic API，开箱即用，无需手动配置坐标或模板。适用于吉他学习者快速获取视频中演示的指法谱，尤其适合结构清晰、带数字小节标记的教程类视频。",2,"2026-07-15 02:30:06","CREATED_QUERY"]