popcorn
<p align="center">
<a href="#quick-start">README</a> โข
<a href="LICENSE">โ๏ธ License</a>
</p>
<h1 align="center">
<br>
๐ฟ
<br>
popcorn
<br>
</h1>
<p align="center">
<a href="docs/i18n/README.zh.md">๐จ๐ณ ไธญๆ</a> โข
<a href="docs/i18n/README.ja.md">๐ฏ๐ต ๆฅๆฌ่ช</a> โข
<a href="docs/i18n/README.ko.md">๐ฐ๐ท ํ๊ตญ์ด</a> โข
<a href="docs/i18n/README.es.md">๐ช๐ธ Espaรฑol</a> โข
<a href="docs/i18n/README.de.md">๐ฉ๐ช Deutsch</a> โข
<a href="docs/i18n/README.fr.md">๐ซ๐ท Franรงais</a> โข
<a href="docs/i18n/README.pt.md">๐ง๐ท Portuguรชs</a> โข
<a href="docs/i18n/README.ru.md">๐ท๐บ ะ ัััะบะธะน</a> โข
<a href="docs/i18n/README.ar.md">๐ธ๐ฆ ุงูุนุฑุจูุฉ</a> โข
<a href="docs/i18n/README.it.md">๐ฎ๐น Italiano</a> โข
<a href="docs/i18n/README.nl.md">๐ณ๐ฑ Nederlands</a> โข
<a href="docs/i18n/README.tr.md">๐น๐ท Tรผrkรงe</a> โข
<a href="docs/i18n/README.vi.md">๐ป๐ณ Tiแบฟng Viแปt</a> โข
<a href="docs/i18n/README.hi.md">๐ฎ๐ณ เคนเคฟเคจเฅเคฆเฅ</a>
</p>
<h4 align="center">An agent skill that gives any coding agent the ability to watch and understand video. Works with <a href="https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview" target="_blank">Claude Code</a>, <a href="https://openai.com/index/introducing-codex/" target="_blank">Codex</a>, and any MCP-compatible agent.</h4>
<p align="center">
<a href="LICENSE">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License">
</a>
<a href="package.json">
<img src="https://img.shields.io/badge/version-0.4.0-green.svg" alt="Version">
</a>
<a href="package.json">
<img src="https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg" alt="Node">
</a>
<a href="https://modelcontextprotocol.io">
<img src="https://img.shields.io/badge/MCP-Compatible-purple.svg" alt="MCP Compatible">
</a>
</p>
<br>
<p align="center">
<a href="#quick-start">Quick Start</a> โข
<a href="#how-it-works">How It Works</a> โข
<a href="#mcp-tools">MCP Tools</a> โข
<a href="#transcription-backends">Transcription</a> โข
<a href="#configuration">Configuration</a> โข
<a href="#troubleshooting">Troubleshooting</a> โข
<a href="#license">License</a>
</p>
<p align="center">
Popcorn enables AI agents to watch and understand long-form videos by extracting transcripts, detecting scene changes, and returning key frames. Everything runs locallyโno external APIs, no fees, complete privacy.
</p>
---
## Quick Start
```bash
# Install FFmpeg (required)
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu/Debian
# Install Popcorn
git clone https://github.com/anthropics/popcorn.git
cd popcorn && npm install && npm run build
# Optional: Install a transcription backend
pip install mlx-whisper # Apple Silicon (fastest)
pip install openai-whisper # Any platform
```
Add to Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
"mcpServers": {
"popcorn": {
"command": "node",
"args": ["/path/to/popcorn/dist/index.js"]
}
}
}
```
**Key Features:**
- **Scene Detection** โ Captures frames at visual transitions, not fixed intervals
- **Local Transcription** โ 4 backend options (mlx-whisper, faster-whisper, whisper-cpp, whisper)
- **Inline Images** โ Returns key frames directly in MCP responses
- **Smart Presets** โ Auto-configures for screencasts, presentations, movies, interviews
- **Zero Config** โ Just pass a video path and it works
- **Privacy First** โ Everything runs locally, no data leaves your machine
---
## Documentation
### Getting Started
- **[Quick Start](#quick-start)** โ Installation & setup
- **[Tutorial](docs/tutorial.md)** โ Step-by-step usage guide
- **[MCP Tools](#mcp-tools)** โ Available tools reference
### Guides
- **[Transcription Backends](#transcription-backends)** โ Choose the best backend for your system
- **[Video Types & Objectives](#video-types)** โ Presets for different content
- **[Configuration](#configuration)** โ Advanced parameters
### Reference
- **[Troubleshooting](docs/troubleshooting.md)** โ Common issues & solutions
- **[Agent Skill](skills/popcorn-video-analysis/SKILL.md)** โ Instructions for AI agents
- **[API Reference](#mcp-tools)** โ Tool schemas & responses
---
## How It Works
**Core Components:**
1. **FFprobe** โ Extracts video metadata (duration, resolution, codecs)
2. **FFmpeg Scene Detection** โ Finds visual transitions using `select='gt(scene,N)'` filter
3. **Parallel Frame Extraction** โ Captures JPEGs at scene change timestamps
4. **Multi-Backend Transcription** โ Whisper variants convert audio to timestamped text
5. **Analysis Bundle** โ Results saved to `.popcorn/` directory
6. **MCP Response** โ Returns metadata + inline base64 images
```
Video File โโโถ FFprobe โโโถ FFmpeg โโโถ Whisper โโโถ Analysis Bundle
โ โ โ โ
โผ โผ โผ โผ
metadata frames transcript MCP Response
```
---
## MCP Tools
| Tool | Description |
|------|-------------|
| `popcorn_analyze` | Main analysis โ extracts frames, transcribes audio, returns results |
| `popcorn_suggest` | Probe video metadata and get recommended settings |
| `popcorn_presets` | List available video types and objectives |
| `popcorn_backends` | Detect your system and show transcription options |
| `popcorn_read` | Read transcript slices with time filtering |
### Basic Usage
```json
{
"tool": "popcorn_analyze",
"arguments": {
"path": "/path/to/video.mp4"
}
}
```
### With Presets
```json
{
"tool": "popcorn_analyze",
"arguments": {
"path": "/path/to/video.mp4",
"videoType": "screencast",
"objective": "detailed"
}
}
```
---
## Video Types
| Type | Best For | Scene Detection |
|------|----------|-----------------|
| `screencast` | Tutorials, coding sessions, UI demos | Low threshold |
| `presentation` | Slides, lectures, keynotes | Slide transitions |
| `movie` | Films, TV shows | Balanced |
| `interview` | Podcasts, talking heads | Transcription priority |
| `surveillance` | Security footage, dashcam | High threshold |
| `sports` | Live events, fast action | High frame rate |
## Objectives
| Objective | Use When |
|-----------|----------|
| `summary` | Quick overview needed |
| `detailed` | Don't miss anything |
| `find_moment` | Searching for specific content |
| `transcribe` | Audio/speech is most important |
| `visual_only` | Only care about visuals |
| `quick_scan` | Fast preview needed |
---
## Transcription Backends
Popcorn auto-detects your system and recommends the best backend.
### Backend Comparison
| Backend | Speed | Best For | Install |
|---------|-------|----------|---------|
| **mlx-whisper** | Fastest | Apple Silicon (M1/M2/M3/M4) | `pip install mlx-whisper` |
| **faster-whisper** | Fast | NVIDIA GPUs | `pip install faster-whisper` |
| **whisper-cpp** | Moderate | Cross-platform | `brew install whisper-cpp` |
| **whisper** | Slow | Most compatible | `pip install openai-whisper` |
### Processing Times (60-min video)
| Backend | Time |
|---------|------|
| mlx-whisper | 3-8 min |
| faster-whisper | 5-10 min |
| whisper-cpp | 10-20 min |
| whisper | 30-60 min |
### Force a Backend
```json
{
"tool": "popcorn_analyze",
"arguments": {
"path": "/path/to/video.mp4",
"backend": "mlx-whisper"
}
}
```
---
## Configuration
### All Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| `path` | string | **Required.** Absolute path to video file |
| `videoType` | string | Video type preset |
| `objective` | string | Analysis objective preset |
| `transcribe` | boolean | Enable/disable transcription |
| `backend` | string | Transcription backend |
| `model` | string | Whisper model (`tiny`, `base`, `small`, `medium`, `large`) |
| `language` | string | Language code (e.g., `en`, `es`, `fr`) |
| `frameMode` | string | `scene` or `interval` |
| `sceneThreshold` | number | Scene sensitivity (0-1) |
| `maxFrames` | number | Maximum frames to extract |
| `inlineFrames` | number | Frames to return as base64 |
### Output Structure
```
.popcorn/<video>_<timestamp>/
โโโ analysis.json # Full metadata
โโโ transcript.txt # Plain text
โโโ transcript.json # Timestamped segments
โโโ transcript.chunks.json # LLM-friendly chunks
โโโ assets/
โโโ audio.wav
โโโ frames/
โโโ scene_000001.jpg
โโโ ...
```
---
## Troubleshooting
### FFmpeg not found
```bash
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu/Debian
```
### No transcription backend
```bash
pip install mlx-whisper # Apple Silicon
pip install openai-whisper # Any platform
```
### Too few frames detected
```json
{ "sceneThreshold": 0.15, "minSceneInterval": 2 }
```
### Too many frames detected
```json
{ "sceneThreshold": 0.5, "minSceneInterval": 10 }
```
See **[Troubleshooting Guide](docs/troubleshooting.md)** for more solutions.
---
## Development
```bash
npm install # Install dependencies
npm run build # Build
npm run dev # Development mode
npm start # Run server
```
### Project Structure
```
popcorn/
โโโ src/
โ โโโ index.ts # MCP server
โ โโโ analyze.ts # Analysis pipeline
โ โโโ ffmpeg.ts # Video processing
โ โโโ transcribe.ts # Multi-backend transcription
โ โโโ presets.ts # Video type presets
โ โโโ commands.ts # Shell execution
โโโ docs/ # Documentation
โโโ skills/ # Agent skills
```
---
## Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing`)
3. Commit changes (`git commit -m 'Add amazing feature'`)
4. Push to branch (`git push origin feature/amazing`)
5. Open a Pull Request
---
## License
MIT License โ see [LICENSE](LICENSE) for details.
---
## Acknowledgments
- [OpenAI Whisper](https://github.com/openai/whisper) โ Speech recognition
- [whisper.cpp](https://github.com/ggerganov/whisper.cpp) โ C++ port
- [MLX Whisper](https://github.com/ml-explore/mlx-examples) โ Apple Silicon
- [faster-whisper](https://github.com/guillaumekln/faster-whisper) โ CTranslate2
- [FFmpeg](https://ffmpeg.org/) โ Video processing
- [Model Context Protocol](https://modelcontextprotocol.io/) โ MCP spec
---
<p align="center">
Made with ๐ฟ for AI agents everywhere
</p>
TDQS
Scored across 5 tools
Each tool has a clear, distinct purpose: suggest probes and recommends settings, presets lists options, analyze performs the analysis, read accesses results, and backends shows system capabilities. No two tools appear to do the same thing.
All tools share a consistent popcorn_ prefix, but the suffix style mixes verbs (suggest, analyze, read) with nouns (presets, backends). This is a minor deviation from a uniform verb_noun pattern, but the names are still predictable and readable.
With 5 tools, the set is well-scoped for video analysis. Each tool covers a distinct step in the workflow (probe, list options, analyze, read output, check backends), earning its place without redundancy.
The tool surface provides a complete workflow: suggest gives metadata and recommended settings, analyze runs the analysis, and read retrieves results. Presets and backends offer configuration information. No critical operations are missing for the stated purpose.