/media-os:ffmpeg-frames-images [action] [input]from media-os
Extracts frames, creates thumbnails, builds sprite/contact sheets, converts image sequences to video, and generates high-quality GIFs using ffmpeg.
Ships in media-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
Frame extraction and image I/O with ffmpeg: single stills, periodic frame dumps, contact sheets, sprite sheets for scrubbers, high-quality GIFs, and building video back from an image sequence.
Choose exactly one shape; each has its own command pattern.
screenshot — one still image at a timestamp.sequence — many images at regular intervals (fps=1 = 1/sec, fps=1/10 = every 10s).sheet — one image that is a grid (tile=MxN) of stamps across the video.sprite — same as sheet but sized for a web player's scrubber.gif — animated GIF (two-command palette workflow).images-to-video — reverse direction: image sequence → MP4.thumbnail-smart — let ffmpeg pick a "representative" frame.keyframes-only — export only frames marked as keyframes.# Input-side seek is FAST (keyframe-snapped, may be a few ms off).
ffmpeg -ss 00:01:30 -i in.mp4 -vframes 1 -q:v 2 out.jpg
# Frame-accurate (SLOW, decodes from 0):
ffmpeg -i in.mp4 -ss 00:01:30 -vframes 1 -q:v 2 out.jpg
# Lossless PNG instead of JPG:
ffmpeg -ss 90 -i in.mp4 -vframes 1 -c:v png out.png
# 1 frame / second:
ffmpeg -i in.mp4 -vf fps=1 frame_%04d.jpg
# 1 frame / 10 seconds:
ffmpeg -i in.mp4 -vf fps=1/10 frame_%04d.jpg
# Higher JPG quality (2 = best, 31 = worst):
ffmpeg -i in.mp4 -vf fps=1 -q:v 2 frame_%04d.jpg
ffmpeg -i in.mp4 \
-vf "fps=1/5,scale=320:-1,tile=4x4" \
-frames:v 1 sheet.jpg
ffmpeg -i in.mp4 \
-vf "fps=1/10,scale=160:-1,tile=10x10" \
-frames:v 1 sprites.jpg
Each sprite cell is 160 x (160/aspect). For a 16:9 video that's 160x90. With 100 cells and a 10s interval you cover 1000 seconds of runtime per sheet. See references/recipes.md for HLS EXT-X-IMAGE-STREAM-INF math.
ffmpeg -i in.mp4 -vf "thumbnail=100,scale=640:-1" -frames:v 1 thumb.jpg
thumbnail=100 scans 100 consecutive frames and picks the most "typical" one (lowest histogram distance to the group average). Good for avoiding black/blurred frames.
ffmpeg -i in.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr key_%04d.jpg
# 1) Generate an optimized palette
ffmpeg -i in.mp4 \
-vf "fps=15,scale=480:-1:flags=lanczos,palettegen=max_colors=256" \
-y palette.png
# 2) Apply the palette with dithering
ffmpeg -i in.mp4 -i palette.png \
-lavfi "fps=15,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" \
-y out.gif
There is no reliable one-shot GIF command that gives this quality. The two-pass palettegen → paletteuse flow is the standard.
# Note: -framerate goes BEFORE -i (it's an input option for image2).
ffmpeg -framerate 30 -i img_%04d.png \
-c:v libx264 -pix_fmt yuv420p out.mp4
# Glob instead of numeric pattern:
ffmpeg -framerate 30 -pattern_type glob -i 'img_*.png' \
-c:v libx264 -pix_fmt yuv420p out.mp4
# Start numbering at a non-zero index:
ffmpeg -framerate 24 -start_number 100 -i img_%04d.png out.mp4
Before shipping, confirm you got what you expected.
# How many images landed on disk:
ls frame_*.jpg | wc -l
# Expected count for fps=1/N on a duration T:
# floor(T / N) + 1
# (ffmpeg rounds to the nearest frame; off-by-one is normal.)
# Re-check a produced sheet's dimensions:
ffprobe -v error -select_streams v:0 -show_entries stream=width,height \
-of csv=p=0 sheet.jpg
scripts/frames.py — wrapper around all of the above. Subcommands:
screenshot, every, sheet, sprite, gif, images-to-video.
Supports --dry-run and --verbose. Stdlib-only Python; no prompts.# Screenshot at 1m30s:
uv run ${CLAUDE_SKILL_DIR}/scripts/frames.py screenshot \
--input in.mp4 --time 00:01:30 --output thumb.jpg
# 4x4 contact sheet at 5s intervals:
uv run ${CLAUDE_SKILL_DIR}/scripts/frames.py sheet \
--input in.mp4 --cols 4 --rows 4 --interval 5 --width 320 --output sheet.jpg
# Two-pass GIF:
uv run ${CLAUDE_SKILL_DIR}/scripts/frames.py gif \
--input in.mp4 --fps 15 --width 480 --output out.gif
# Rebuild video from PNGs:
uv run ${CLAUDE_SKILL_DIR}/scripts/frames.py images-to-video \
--pattern 'img_%04d.png' --fps 30 --output out.mp4
Read references/recipes.md when:
pattern_type, start_number, loop, framerate).EXT-X-IMAGE-STREAM-INF playlists.-ss before -i is FAST but keyframe-snapped — the chosen time snaps to the nearest preceding keyframe. Off by up to the GOP length (often ~2s). Great for thumbnails.-ss after -i is FRAME-ACCURATE but slow — ffmpeg decodes from frame 0 to the target. Use only when exact frame matters.-q:v 2 is best-JPEG-quality. Scale is 2–31, LOWER is better. 2 is visually lossless-ish, 5 is web-quality, 31 is unusable.-frames:v 1 vs -vframes 1 — both work. Prefer -frames:v (stream-specific, modern form).image2 numeric pattern zero-padding must match the %0Nd width. img_%04d.png means files must be img_0001.png, not img_1.png, or you'll get "could not find codec parameters" errors.-pattern_type glob. Otherwise ffmpeg treats img_*.png as a literal filename.ffmpeg -i in.mp4 out.gif produces banded, washed-out garbage.paletteuse=dither=bayer:bayer_scale=5 is the quality/size sweet spot. dither=none bands heavily; dither=floyd_steinberg is prettiest but noticeably larger.-framerate vs -r. -framerate is an INPUT option for the image2 demuxer (rate at which images are READ). -r is an OUTPUT option (rate STAMPED on the output). For image sequence → video, set -framerate BEFORE -i.tile must match what you feed it. A 4x4 tile expects exactly 16 frames — use -frames:v 1 to stop after the first tiled output and trim the fps to produce at least 16 frames' worth.thumbnail=N needs N frames in the window. If the source is shorter than N frames, the filter still works but samples what it has. Default N is 100.ffmpeg may not be on PATH in non-interactive shells. If your script fails with command not found, invoke with an absolute path (e.g. /opt/homebrew/bin/ffmpeg).ffmpeg -ss 00:01:30 -i lecture.mp4 -vframes 1 -q:v 2 -vf "scale=1280:-1" poster.jpg
Result: 1280-wide JPEG, keyframe-snapped (fast).
For a 3600s video, sampling every 10s = 360 thumbs. A 19x19 grid (361 cells) covers it:
ffmpeg -i movie.mp4 \
-vf "fps=1/10,scale=160:-1,tile=19x19" \
-frames:v 1 sprites.jpg
Result: one JPG, ~3040x1710 pixels at 16:9, ready to slice on the client.
# 1) palette
ffmpeg -ss 10 -t 10 -i clip.mp4 \
-vf "fps=15,scale=480:-1:flags=lanczos,palettegen" -y palette.png
# 2) use palette
ffmpeg -ss 10 -t 10 -i clip.mp4 -i palette.png \
-lavfi "fps=15,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" \
-y demo.gif
Result: ~2–3 MB GIF, no visible banding.
Blender wrote render_0001.png … render_0240.png at 24 fps:
ffmpeg -framerate 24 -i render_%04d.png \
-c:v libx264 -pix_fmt yuv420p -crf 18 render.mp4
Result: 10-second MP4, high quality, broadly compatible.
Could not find codec parameters for stream 0 (Video: none): unknown codecCause: image pattern's zero-padding doesn't match the actual filenames.
Solution: rename files, or change %04d to match the real padding, or switch to -pattern_type glob -i 'img_*.png'.
Output file #0 does not contain any streamCause: -ss placed after -i with an offset past the end of the video, OR thumbnail/select filtered everything out.
Solution: verify the timestamp with ffprobe -show_entries format=duration; for select filters, loosen the predicate or pair with -vsync vfr.
Cause: skipped the palette step, or used dither=none.
Solution: run the two-pass palettegen + paletteuse=dither=bayer:bayer_scale=5 workflow in section 2g.
Cause: you used -r (output rate) when you needed -framerate (input rate). ffmpeg defaults to 25 fps on the image2 demuxer if neither is set.
Solution: put -framerate N BEFORE -i img_%04d.png.
tile filter complains about missing frames / produces a partial gridCause: fps didn't produce enough frames to fill MxN.
Solution: either lower the interval (more frames), reduce the grid (2x2), or accept a partial tile.
Cause: missing -q:v.
Solution: add -q:v 2 (best) through -q:v 7 (web). Remember: lower = better.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
/audio-pipewireRoute and introspect Linux audio/video/MIDI graphs with PipeWire: pw-cli (interactive object/module control), pw-dump (full graph JSON with --monitor), pw-link (list/create/destroy port links), pw-cat / pw-play / pw-record (playback+record), pw-top (real-time DSP load + xrun viewer), pw-metadata (shared metadata store), pw-loopback (source/sink bridges), pw-midiplay/pw-midirecord, pw-jack (JACK client compat shim), pw-mon, pw-profiler. WirePlumber session manager handles routing/defaults/profiles. Replaces PulseAudio (via pipewire-pulse) and JACK (via libjack.so shim) simultaneously. Use when the user asks to route Linux audio, link two apps, list audio devices on Linux, create a loopback, record system audio, monitor the audio graph, or set up a virtual audio device on modern Linux.
/audio-wasapiManipulate Windows audio via WASAPI (learn.microsoft.com/coreaudio): SoundVolumeView + svcl.exe (NirSoft — set default device, per-app volumes, save/load profiles), AudioDeviceCmdlets PowerShell module (Get-AudioDevice, Set-AudioDevice, Get-AudioDevicePlaybackMute), nircmd setdefaultsounddevice. Shared mode (Windows engine resamples all streams to endpoint fixed format) vs Exclusive mode (bit-perfect, audiophile, ~sub-3ms latency with IAudioClient3 + event-driven callbacks). WASAPI then MMDevice then Audio Engine (audiodg.exe) then WDM/KS. ASIO is Steinberg's parallel stack bypassing Windows audio. Virtual audio devices: VB-Audio Virtual Cable, VoiceMeeter/Banana/Potato. Use when the user asks to change Windows default audio device, route app audio, use VoiceMeeter, install VB-Cable, set a specific device from PowerShell, or enable exclusive-mode low-latency output.
/cv-mediapipeGoogle MediaPipe Tasks API (current supported, NOT legacy mediapipe.solutions): Vision Tasks (Face Detector, Face Landmarker, Face Stylizer, Hand Landmarker, Gesture Recognizer, Pose Landmarker, Holistic Landmarker, Object Detector, Image Classifier, Image Segmenter, Interactive Segmenter, Image Embedder, Image Generator), Audio Tasks (Audio Classifier), Text Tasks (Text Classifier, Text Embedder, Language Detector), GenAI Tasks (LLM Inference — on-device Gemma/Phi-2/Falcon/StableLM). Three run modes: IMAGE, VIDEO, LIVE_STREAM (async). Python: mediapipe.tasks.python.vision/audio/text/genai. Docs at ai.google.dev/edge/mediapipe/solutions. Model Maker for transfer learning. Use when the user asks to detect pose/face/hand landmarks, classify an image, run a body-pose model, segment people, recognize gestures, do on-device LLM inference via MediaPipe, or build a mobile/embedded CV pipeline.
/cv-opencvComputer vision on images + video with OpenCV (docs.opencv.org/4.x/): core (Mat / ndarray, linalg), imgproc (filtering, morphology, geometric transforms, color conv, histograms, contours), imgcodecs (imread/imwrite — PNG, JPEG, TIFF, WebP, EXR), videoio (VideoCapture / VideoWriter — FFMPEG, GStreamer, V4L2, AVFoundation, MSMF backends), calib3d (camera calibration, stereo, solvePnP, homography), features2d (ORB, AKAZE, BRISK, KAZE, SIFT), objdetect (FaceDetectorYN, FaceRecognizerSF, HOG, ArUco, QRCode), dnn (ONNX/TF/Caffe/Darknet, CUDA + OpenVINO + Vulkan backends, model zoo at github.com/opencv/opencv_zoo), photo (inpainting, denoising, HDR Debevec/Robertson), stitching (panorama), video (optical flow Farneback/LK/DIS, BackgroundSubtractorMOG2/KNN, tracking KCF/CSRT/MIL/Nano/Vit/DaSiamRPN). Python-first via cv2. Use when the user asks to detect faces, track objects, run YOLO inference, capture + process webcam frames, calibrate a camera, stitch a panorama, or use OpenCV from Python/C++.
npx claudepluginhub damionrashford/media-os --plugin media-osOther plugins' skills for the same job