Skip to main content
Glama
README.md
# vid2md

**Let Claude (or any LLM) "watch" videos for a fraction of the tokens.**

`vid2md` turns a video into compact Markdown, the way [MarkItDown](https://github.com/microsoft/markitdown) does for documents:

- **Transcript from existing captions**: YouTube/Vimeo/etc. captions via `yt-dlp`, or subtitles embedded in / next to a local file. No audio processing, no tokens, seconds to run.
- **On-screen text without vision tokens**: slides, titles, code and labels are read with ffmpeg scene-change keyframes + **local Tesseract OCR**, de-duplicated and interleaved with the transcript by timestamp.
- **Fallback**: no captions? Transcribes locally with `faster-whisper` (optional).
- Chapters, title, channel and duration included. Works as a **CLI**, an **MCP server** and a **Claude Code plugin** (skill + MCP).

Example: a 19-minute lecture with slides becomes ~5,500 tokens of Markdown, versus tens of thousands of tokens to send keyframes as images.

```markdown
### What are neurons?

> 🖼 **On screen [03:00]**
> Neuron — that holds a number

**[02:43]** As the name suggests neural networks are inspired by the brain, but let's break that down...
```

## Install

System dependencies: `ffmpeg` and (for `--frames`) `tesseract` with the language packs you need.

```bash
# Arch
sudo pacman -S ffmpeg tesseract tesseract-data-eng tesseract-data-por
# Debian/Ubuntu
sudo apt install ffmpeg tesseract-ocr tesseract-ocr-eng tesseract-ocr-por
# macOS
brew install ffmpeg tesseract tesseract-lang
```

Then the tool itself:

```bash
pipx install git+https://github.com/samvanderhagen/vid2md
# optional local transcription when a video has no captions:
pipx install "vid2md[whisper] @ git+https://github.com/samvanderhagen/vid2md"
```

## Use

```bash
vid2md "https://www.youtube.com/watch?v=VIDEO_ID"           # transcript only
vid2md "https://www.youtube.com/watch?v=VIDEO_ID" --frames  # + on-screen text
vid2md lecture.mp4 --frames -o lecture.md                   # local file
```

| Option | What it does |
| --- | --- |
| `-f, --frames` | OCR on-screen text (downloads the video at ≤720p for URLs) |
| `-l, --lang pt` | Preferred transcript language |
| `--ocr-lang eng+por` | Tesseract languages |
| `--keep-frames DIR` | Save the unique keyframes, so the model can look at only the 1–2 it really needs |
| `--scene 0.3` / `--max-gap 20` | Keyframe sensitivity / sample at least every N seconds |
| `--description` | Include the video description |
| `--cookies-from-browser firefox` | Reuse your browser's YouTube login if YouTube says "confirm you're not a bot" (also `--cookies FILE`, or env `VID2MD_COOKIES_FROM_BROWSER`) |
| `--no-whisper`, `--whisper-model small` | Control the local transcription fallback |

## Use with Claude Code

As a plugin (skill that teaches Claude to use vid2md + the MCP server):

```
/plugin marketplace add samvanderhagen/vid2md
/plugin install vid2md@vid2md
```

Or only the MCP server:

```bash
claude mcp add vid2md -- vid2md-mcp
```

Then just paste a video link and ask for a summary. Claude Desktop / other MCP clients: run `vid2md-mcp` as a stdio server.

## How it saves tokens

1. **Captions first.** Platforms already have the transcript; fetching it costs nothing.
2. **Rolling auto-captions de-duplicated.** YouTube auto-captions repeat each line twice; they are merged into timestamped paragraphs.
3. **Frames → text locally.** Only frames where the scene changes (or every 20 s) are OCR'd; noise and repeated slides are dropped.
4. **Images only when needed.** With `--keep-frames`, the model can open a single frame instead of the whole video.

## Limitations

- OCR reads text, not diagrams, faces or math notation; check the saved frame when it matters.
- Auto-captions and OCR contain errors.
- Respect the platforms' terms and copyright: use it for videos you are allowed to process.

## License

MIT

TDQS

A4.2/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of misselection or overlapping purpose. Its single function — video to Markdown conversion — is clearly stated and distinct.

Naming Consistency5/5

The single name video_to_markdown is clear, descriptive, and uses standard snake_case verb_object convention. With one tool there is no convention mixing, and the name conveys the action and target.

Tool Count4/5

A single tool is slightly thin, but the server's domain (video-to-Markdown extraction) is narrow enough that one richly parameterized tool covers it. The options (frames, lang, cookies, description) are sensibly folded into arguments rather than split into extra tools.

Completeness4/5

The surface covers both URL and local-file sources, caption/subtitle/Whisper fallbacks, OCR of keyframes, and language selection — the core lifecycle of the stated purpose. Minor gaps exist, such as no way to list available transcript languages or inspect keyframes without saving them to a directory first.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues