Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tabgrab

Extract guitar tabs from YouTube videos and save them as a PDF, automatically.

How it works

  1. Downloads the video via yt-dlp
  2. Extracts frames every N seconds via ffmpeg
  3. Sends each frame to a local vision model (LLaVA via Ollama) to detect and read tab notation
  4. Deduplicates repeated frames
  5. Compiles everything into a formatted PDF

Requirements

System:

sudo apt install ffmpeg

Ollama:

Install Ollama and pull the vision model:

curl -fsSL https://ollama.com/install.sh | sudo sh
ollama pull llava
ollama serve

Python:

pip install yt-dlp ollama reportlab Pillow

Usage

python tabgrab.py "https://youtu.be/your_video"

Options:

# Sample frames more frequently (good for fast-moving tabs)
python tabgrab.py "https://youtu.be/xxx" --interval 1

# Custom output file and PDF title
python tabgrab.py "https://youtu.be/xxx" --output mysong.pdf --title "Hotel California"

# Use a different Ollama vision model
python tabgrab.py "https://youtu.be/xxx" --model minicpm-v
Flag Default Description
--interval 2.0 Seconds between frame samples
--output guitar_tabs.pdf Output PDF filename
--title Guitar Tabs Title shown in the PDF
--model llava Ollama vision model to use

Tips

  • If tabs are being missed, try --interval 1 to sample more frames
  • 720p download is used by default to keep things fast
  • LLaVA works best on clean, high-contrast tab displays
  • If accuracy is poor, try minicpm-v as an alternative model: ollama pull minicpm-v

License

MIT

About

Grab guitar tabs from youtube videos

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages