Food for your model — extract transcripts, key frames, OCR, slides, and LLM summaries from YouTube videos into structured AI-ready knowledge.
---
name: "YouTube Model Feeder"
description: "Food for your model — extract transcripts, key frames, OCR, slides, and LLM summaries from YouTube videos into structured AI-ready knowledge."
version: "1.0.0"
emoji: "🧠"
homepage: "https://github.com/celstnblacc/youtube-model-feeder"
user-invocable: true
disable-model-invocation: false
requires:
bins: ["docker"]
anyBins: ["ffmpeg"]
env: []
---
# YouTube Model Feeder
> **Food for your model.**
Stop pausing videos every 30 seconds to screenshot, paste into Obsidian, and caption. Every 20-minute tutorial shouldn't take an hour to document.
YouTube Model Feeder extracts everything from a YouTube video — timestamped transcript, key frame snapshots, OCR of code and slides, presentation slide detection, and LLM-generated summaries — and packages it into structured knowledge your AI assistant can search, reference, and reason about.
## Why This Exists
The problem isn't transcription — ten tools do that. The problem is **structured context**. When you feed a raw transcript to a model, it has no visual context. It doesn't know what was on screen when the speaker said "as you can see here." It can't read the code in the terminal, the diagram on the slide, or the config file being edited.
YouTube Model Feeder captures all of that. The output isn't just text — it's a knowledge bundle: transcript segments aligned to timestamps, screenshots of every key moment, OCR text from code snippets and slides, and an LLM summary that ties it all together.
**Combined with [obsidian-semantic-search](https://clawhub.ai/skills/obsidian-semantic-search)** (also on ClawHub), every video you watch becomes permanently searchable by meaning in your Obsidian vault.
## What It Extracts
### Full Pipeline
| Step | Tool | What it produces |
|------|------|-----------------|
| **Download** | yt-dlp | Video + audio + metadata (title, duration, thumbnail) |
| **Transcribe** | Whisper (Ollama) or YouTube captions | Timestamped transcript segments |
| **Frame Extraction** | FFmpeg | Key frame snapshots every 5s (configurable) |
| **Slide Detection** | SSIM analysis (OpenCV) | Identifies presentation slides via structural similarity between frames |
| **OCR** | Tesseract | Reads code, terminal output, and text from captured frames |
| **LLM Summary** | Ollama / OpenAI / Anthropic | Structured markdown with sections, code blocks, and key takeaways |
### Slide Detection (Deep)
Not just frame captures — intelligent slide boundary detection:
1. **Layout detection** — classifies video as full-frame, picture-in-picture, or split panel
2. **SSIM transition scan** — compares consecutive frames for structural changes (threshold: SSIM < 0.85)
3. **LLM disambiguation** — borderline transitions (0.85–0.93 SSIM) sent to LLM for classification
4. **Slide grouping** — merges transitions into slides with enforced minimum duration (3s)
5. **Final-state capture** — saves the last frame of each slide as JPEG
6. **OCR extraction** — runs Tesseract on each slide image
7. **Transcript alignment** — maps transcript segments to slide time ranges
### Output Formats
| Format | What you get |
|--------|-------------|
| **Markdown** | Timestamped sections with headings, code blocks, image references |
| **HTML** | Styled single-page doc with embedded screenshots |
| **Obsidian bundle** | ZIP export: markdown + images, ready to drop into your vault |
## Installation
### Prerequisites
```bash
# macOS
brew install ffmpeg tesseract
# Linux
apt install ffmpeg tesseract-ocr
```
Docker Desktop must be running for the full backend.
### Start the Stack
```bash
git clone https://github.com/celstnblacc/youtube-model-feeder.git
cd youtube-model-feeder
docker-compose up -d
```
This starts 5 services:
| Service | Port | Purpose |
|---------|------|---------|
| **api** | 8000 | FastAPI backend + Swagger docs at `/docs` |
| **celery_worker** | — | Background video processing |
| **postgres** | 5432 | Job tracking, transcripts, documents |
| **redis** | 6379 | Task queue (Celery broker) |
| **web** | 3000 | Next.js frontend (optional) |
### Verify
Open `http://localhost:8000/docs` — you should see the Swagger API documentation.
## Usage
### Via AI Assistant
**Extract a video:**
> "Extract everything from this YouTube video and save it to my vault: https://youtube.com/watch?v=..."
**Transcript only:**
> "Get the timestamped transcript for this video"
**Slides and code screenshots:**
> "Extract all the code screenshots and presentation slides from this tutorial"
**Obsidian export:**
> "Convert this video into an Obsidian note with screenshots and timestamps"
### Via API
```bash
# Submit a video for processing
curl -X POST http://localhost:8000/jobs \
-H "Content-Type: application/json" \
-d '{"url": "https://youtube.com/watch?v=dQw4w9WgXcQ"}'
# Check job status
curl http://localhost:8000/jobs/{job_id}
# Get the generated document
curl http://localhost:8000/videos/{video_id}
```
### Via Web UI
Open `http://localhost:3000`, paste a YouTube URL, and watch the extraction happen in real time with progress tracking.
## LLM Provider Selection
Per-user configuration — choose your summarization engine:
| Provider | Model (default) | Setup | Cost |
|----------|----------------|-------|------|
| **Ollama** (default) | Mistral 7B | Pre-installed locally | Free |
| **OpenAI** | GPT-4o-mini | Set `OPENAI_API_KEY` | Per-token |
| **Anthropic** | Claude Sonnet 4.6 | Set `ANTHROPIC_API_KEY` | Per-token |
Configure via the API: `PATCH /settings/me` with your preferred provider and API key (encrypted at rest with Fernet).
## The Knowledge Pipeline
YouTube Model Feeder is designed to work with other ClawHub skills:
```
YouTube Video
→ youtube-model-feeder (extract transcript + snapshots + OCR + summary)
→ Obsidian vault (structured markdown + images)
→ obsidian-semantic-search (index with embeddings, search by meaning)
→ Your AI assistant (full context from every video you've ever watched)
```
Every video becomes permanent, searchable knowledge. Not buried in a playlist — indexed and queryable.
## Architecture
```
youtube-model-feeder/
├── backend/ # FastAPI + Celery (Python 3.12)
│ ├── app/
│ │ ├── services/ # Core extraction pipeline (6372 LOC)
│ │ │ ├── youtube.py # yt-dlp wrapper
│ │ │ ├── transcript.py # Whisper + YouTube captions
│ │ │ ├── snapshot.py # FFmpeg frame extraction
│ │ │ ├── slide_detection.py # SSIM + OCR + alignment (643 LOC)
│ │ │ ├── llm.py # Summarization engine (1229 LOC)
│ │ │ └── llm_providers.py # Ollama/OpenAI/Anthropic abstraction
│ │ ├── routes/ # REST API endpoints
│ │ └── tasks.py # Celery background jobs
├── frontend/ # Next.js 14 + React 18 + Tailwind + Zustand
├── docker-compose.yml # 5 services
└── migrations/ # Alembic database migrations
```
## Troubleshooting
| Problem | Fix |
|---------|-----|
| VirusTotal "suspicious" warning on install | False positive — skill describes video extraction patterns. Use `clawhub install youtube-model-feeder --force` |
| Docker services won't start | Ensure Docker Desktop is running. Check `docker-compose logs api` for errors |
| Transcription is slow | First run pulls the Whisper model (~1.5 GB). Subsequent runs are fast. Try YouTube captions first (faster, no model needed) |
| No slides detected | SSIM threshold may need tuning for your video type. Presentation-style videos work best |
| LLM summary is empty | Check LLM provider config. Default is Ollama — ensure Ollama is running with a model pulled |
| FFmpeg not found | `brew install ffmpeg` (macOS) or `apt install ffmpeg` (Linux) |
## Links
- **Source:** https://github.com/celstnblacc/youtube-model-feeder
- **Obsidian Semantic Search:** https://clawhub.ai/skills/obsidian-semantic-search
- **License:** MIT-0 (this skill) / Apache 2.0 (source)
---
*Built by [celstnblacc](https://github.com/celstnblacc) — food for your model. 226 tests, 6 extraction stages, 3 LLM providers, Obsidian-ready output.*
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit decision points for api key fallbacks and edge cases, restructured into implexa's 6-part format with detailed procedure steps including frame extraction batching and ssim thresholding, documented all external dependencies (docker, ffmpeg, tesseract, postgres, redis) with setup guidance, and clarified output contract with file locations and json schemas
stop pausing videos every 30 seconds to screenshot, paste into obsidian, and caption. youtube model feeder extracts everything from a video, timestamp by timestamp, into structured knowledge your ai assistant can search and reason about.
use this skill when you need to convert a youtube video into machine-readable knowledge. extract timestamped transcripts, key frame snapshots, optical character recognition of slides and code, presentation slide boundaries, and llm-generated summaries all in one pass. feed the output directly to obsidian, vector databases, or your ai context window. the skill works best on tutorial videos, talks, and presentations where visual content (code, diagrams, slides) matters as much as audio.
required external services and binaries:
brew install ffmpeg (macos) or apt install ffmpeg (linux)brew install tesseract (macos) or apt install tesseract-ocr (linux)required repository and setup:
docker-compose up -d from the repo root to start all servicesoptional external llm api keys:
OPENAI_API_KEY: if using openai for summarization (gpt-4o-mini default model). if not set, skill falls back to ollamaANTHROPIC_API_KEY: if using anthropic for summarization (claude sonnet 3.5 default model). if not set, skill falls back to ollamainput parameters:
context/state:
step 1: download and validate video
step 2: extract transcript
step 3: extract key frames via ffmpeg
step 4: detect presentation slides via ssim and ocr
step 5: ocr slide and frame text
step 6: generate llm summary
step 7: package output
step 8: save to database and signal completion
if youtube captions exist:
if openai_api_key or anthropic_api_key is set:
if frame count > 5000:
if ssim score is between 0.85 and 0.93:
if output_format is obsidian:
if video is shorter than 60 seconds:
if transcript is empty:
successful extraction produces:
transcript document: plain text file or json with array of {timestamp_sec, text} segments. encoding utf-8. file size typically 10-100 kb for 20-minute video
frame manifest: json file with array of {timestamp_sec, filename, width, height}. one entry per extracted frame
slide manifest: json file with array of {slide_id, start_sec, end_sec, representative_image_filename, transcript_segment_ids, ocr_text}
ocr results: json file with array of {image_filename, extracted_text, confidence_score}. one entry per frame or slide
llm summary: markdown file with sections, code blocks, timestamp links, and image references. typically 2-10 pages single-spaced
output bundle format:
.md file with frontmatter (title, duration, url, extraction_date), transcript, slides, ocr, and summary.html file with embedded images and css styling. no external dependencies.zip file containing: root note.md, folder /images with all pngs/jpgs, and optional metadata.json with structured datajob metadata: postgres record with: video_id, url, title, duration, extraction_timestamp, provider_used (ollama/openai/anthropic), status, output_paths
file locations:
/tmp/youtube-model-feeder/{job_id}/ or user-specified output directoryvideos, transcripts, documentsGET /videos/{video_id} with json responseall files are utf-8 encoded. images are jpg or png. markdown follows gfm (github flavored markdown)
the skill worked if:
you can open the generated markdown (or html, or obsidian bundle) and see: video title, duration, url, extraction timestamp, a clickable transcript with timestamps, at least one screenshot from the video, readable ocr of any code or text that appeared, and a well-formatted summary with sections and key takeaways
timestamps in the summary are clickable links (in markdown: [00:34] as a reference; in html and obsidian: actual links to video or timestamps in the note)
images are embedded or linked correctly (obsidian bundle zips contain image files; markdown files reference them with correct relative paths)
ocr text appears where slides or code was on screen. if no slides detected, this is not a failure (some videos have no slides)
llm summary is coherent and references specific moments from the video (e.g. "at 2:34, they explain..." or "the diagram on slide 3 shows...")
api returns 200 ok with complete job metadata and links to all output files
if you feed the output to obsidian-semantic-search, you can search by meaning across all extracted videos (e.g. search "how to configure docker" and find the relevant video + timestamp)
no errors in docker container logs (docker-compose logs api shows no exceptions). if there are warnings (e.g. "slide detection threshold may need tuning"), processing completes anyway and warnings are listed in output metadata
job completes within expected time: <2 min for captions-only extraction, 5-15 min for full pipeline with whisper transcription, depends on video length and hardware