Repository avatar
Multimedia
v0.5.2
active

claude-popcorn

io.github.haithamelmengad/claude-popcorn

Watch local videos from any MCP agent: scene-change key frames and a local Whisper transcript.

Documentation


🍿
popcorn

Popcorn lets Claude Code and other MCP agents watch a video file on your machine.

Claude Code watching a video with Popcorn: key frames, transcript and an answer with the time

It returns key frames from the scene changes and a timestamped transcript.

Install for Claude Code

claude mcp add popcorn -- npx -y claude-popcorn

Or install it as a Claude Code plugin. This also adds the /popcorn:watch skill. Run these inside Claude Code:

/plugin marketplace add haithamelmengad/claude-popcorn
/plugin install popcorn@popcorn

Try it

Ask in plain words and give the full path to the video:

  • Watch /path/to/talk.mp4 and tell me what it is about.
  • In /path/to/talk.mp4, where do they talk about pricing? Give me the time.
  • Give me the transcript of /path/to/talk.mp4 from 0:20 to 0:30.

Works with

ClientSetup
Claude CodeThe command or the plugin above
Claude DesktopAdd the server to claude_desktop_config.json. See Quick Start
Codexcodex mcp add popcorn -- npx -y claude-popcorn
CursorAdd the same mcpServers entry to ~/.cursor/mcp.json

Requirements

  • FFmpeg on your PATH
  • Node.js 20 or newer
  • One Whisper backend for transcripts. Without one you still get the frames. See Transcription Backends

🇨🇳 中文 • 🇯🇵 日本語 • 🇰🇷 한국어 • 🇪🇸 Español • 🇩🇪 Deutsch • 🇫🇷 Français • 🇧🇷 Português • 🇷🇺 Русский • 🇸🇦 العربية • 🇮🇹 Italiano • 🇳🇱 Nederlands • 🇹🇷 Türkçe • 🇻🇳 Tiếng Việt • 🇮🇳 हिन्दी

Quick Start • How It Works • MCP Tools • Transcription • Configuration • Troubleshooting • License


Quick Start

# Install FFmpeg (required)
brew install ffmpeg                    # macOS
sudo apt install ffmpeg                # Ubuntu/Debian

# Optional: Install a transcription backend
pip install mlx-whisper                # Apple Silicon (fastest)
pip install openai-whisper             # Any platform

# Add Popcorn to Claude Code
claude mcp add popcorn -- npx -y claude-popcorn

For Claude Desktop, add this to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "popcorn": {
      "command": "npx",
      "args": ["-y", "claude-popcorn"]
    }
  }
}

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. Whisper models are downloaded once, on first use

Documentation

Getting Started

Guides

Reference


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

ToolDescription
popcorn_analyzeMain analysis: extracts frames, transcribes audio, returns results
popcorn_suggestProbe video metadata and get recommended settings
popcorn_presetsList available video types and objectives
popcorn_backendsDetect your system and show transcription options
popcorn_readRead transcript slices with time filtering

Basic Usage

{
  "tool": "popcorn_analyze",
  "arguments": {
    "path": "/path/to/video.mp4"
  }
}

With Presets

{
  "tool": "popcorn_analyze",
  "arguments": {
    "path": "/path/to/video.mp4",
    "videoType": "screencast",
    "objective": "detailed"
  }
}

Video Types

TypeBest ForScene Detection
screencastTutorials, coding sessions, UI demosLow threshold
presentationSlides, lectures, keynotesSlide transitions
movieFilms, TV showsBalanced
interviewPodcasts, talking headsTranscription priority
surveillanceSecurity footage, dashcamHigh threshold
sportsLive events, fast actionHigh frame rate

Objectives

ObjectiveUse When
summaryQuick overview needed
detailedDon't miss anything
find_momentSearching for specific content
transcribeAudio/speech is most important
visual_onlyOnly care about visuals
quick_scanFast preview needed

Transcription Backends

Popcorn auto-detects your system and recommends the best backend.

Backend Comparison

BackendSpeedBest ForInstall
mlx-whisperFastestApple Silicon (M1/M2/M3/M4)pip install mlx-whisper
faster-whisperFastNVIDIA GPUspip install faster-whisper
whisper-cppModerateCross-platformbrew install whisper-cpp
whisperSlowMost compatiblepip install openai-whisper

whisper-cpp needs a model file. Download a ggml model from whisper.cpp and set the WHISPER_CPP_MODEL environment variable to its path, or pass the path as model. Without a model file, Popcorn reports this backend as not available.

Processing Times (60-min video)

BackendTime
mlx-whisper3-8 min
faster-whisper5-10 min
whisper-cpp10-20 min
whisper30-60 min

Force a Backend

{
  "tool": "popcorn_analyze",
  "arguments": {
    "path": "/path/to/video.mp4",
    "backend": "mlx-whisper"
  }
}

Configuration

All Parameters

ParameterTypeDescription
pathstringRequired. Absolute path to video file
videoTypestringVideo type preset
objectivestringAnalysis objective preset
transcribebooleanEnable/disable transcription
backendstringTranscription backend
modelstringWhisper model (tiny, base, small, medium, large). For whisper-cpp: path to a ggml model file
languagestringLanguage code (e.g., en, es, fr)
frameModestringscene or interval
framesPerMinnumberFrames per minute in interval mode
sceneThresholdnumberScene sensitivity (0-1)
minSceneIntervalnumberMinimum seconds between scene frames
maxFramesnumberMaximum frames to extract
inlineFramesnumberFrames to return as base64
maxChunkCharsnumberTranscript chunk size in characters
maxTranscriptCharsnumberLength of the transcript excerpt in the response
outDirstringOutput directory for the analysis bundle

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

brew install ffmpeg          # macOS
sudo apt install ffmpeg      # Ubuntu/Debian

No transcription backend

pip install mlx-whisper      # Apple Silicon
pip install openai-whisper   # Any platform

Too few frames detected

{ "sceneThreshold": 0.15, "minSceneInterval": 2 }

Too many frames detected

{ "sceneThreshold": 0.5, "minSceneInterval": 10 }

See Troubleshooting Guide for more solutions.


Development

git clone https://github.com/haithamelmengad/claude-popcorn.git
cd claude-popcorn
npm install          # Install dependencies
npm run build        # Build
npm test             # Smoke test (needs ffmpeg)
npm run dev          # Development mode
npm start            # Run server

Project Structure

claude-popcorn/
├── src/
│   ├── index.ts        # MCP server
│   ├── analyze.ts      # Analysis pipeline
│   ├── ffmpeg.ts       # Video processing
│   ├── transcribe.ts   # Multi-backend transcription
│   ├── presets.ts      # Video type presets
│   ├── read.ts         # File and transcript reading
│   └── 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 for details.


Acknowledgments

The demo uses NASA footage of the launch of space shuttle Discovery on mission STS-121: KSC-06-S-00171. NASA content is generally not subject to copyright in the United States, see the NASA media guidelines. NASA does not endorse this project.


Popcorn is an independent project. It is not affiliated with or endorsed by Anthropic.

Made with 🍿 for AI agents everywhere

NPM
claude-popcorn
Install Command
npm install claude-popcorn