/media-os:ffmpeg-video-filter [operation] [input]from media-os
Builds ffmpeg -vf/-filter_complex commands for scaling, cropping, overlay, stacking, deinterlace, color grading, drawtext, and other video effects.
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
-vf "scale=-2:720" → Step 2-vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" → Example 2-filter_complex "[1:v]scale=200:-1[wm];[0:v][wm]overlay=W-w-10:H-h-10" → Example 1-vf "yadif=1" → Example 5-filter_complex "[0:v][1:v]hstack=inputs=2" → Example 3-vf.-filter_complex.split, multiple outputs, or named labels → -filter_complex + -map.-vf vs -filter_complex-vf (and -af for audio) is shorthand for a single-input, single-output chain. Every filter is comma-separated. Example: -vf "scale=1280:720,eq=saturation=1.1,fps=30".
-filter_complex is the general graph. It accepts multiple inputs and outputs, uses [in][out] labels, and chains are separated by semicolons (filters within a chain are still comma-separated). When you use it you must -map every output stream you want in the container — default stream selection is disabled.
Rules of thumb:
-vf.[0:v] or [1:v] → -filter_complex.-filter_complex.Canonical filter order: deinterlace → crop → scale → pad → color/eq → overlay → drawtext → fps → format. Deviating has real cost: cropping after scaling wastes pixels; scaling before cropping blurs detail you were going to throw away.
Scale recipes (scale is the workhorse):
scale=1280:720 # exact
scale=-2:720 # keep aspect, height 720, width rounded to even
scale=1920:-2 # keep aspect, width 1920
scale=iw/2:ih/2 # half size
scale=1920:1080:force_original_aspect_ratio=decrease # fit inside box (letterbox prep)
scale=1920:1080:force_original_aspect_ratio=increase # fill box (crop prep)
scale=1920:1080:flags=lanczos # high-quality downscale
Use -2 (not -1) for the auto dimension: most codecs (H.264/HEVC/AV1 with YUV 4:2:0) require even width and height. -1 preserves aspect but can give odd numbers; -2 preserves aspect AND snaps to a multiple of 2.
Color / eq quick picks:
eq=brightness=0.05:saturation=1.2:contrast=1.1:gamma=1.0
curves=preset=increase_contrast
curves=preset=cross_process
hue=h=10:s=1.2 # shift hue by 10 degrees, saturate
colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3 # luma-weighted grayscale
Overlay with alpha (PNG logo): pre-format the alpha plane so overlay doesn't silently drop it: format=yuva420p.
ffmpeg -i in.mp4 -vf "scale=-2:720" -c:v libx264 -crf 20 -preset medium -c:a copy out.mp4
For -filter_complex, map outputs explicitly:
ffmpeg -i main.mp4 -i logo.png \
-filter_complex "[1:v]scale=200:-1[wm];[0:v][wm]overlay=W-w-10:H-h-10[v]" \
-map "[v]" -map 0:a? -c:a copy out.mp4
Verify the output dimensions/fps with ffprobe:
ffprobe -v error -select_streams v:0 -show_entries stream=width,height,r_frame_rate,pix_fmt out.mp4
scripts/vfilter.py — preset runner (scale-720p, scale-1080p-letterbox, watermark, deinterlace, drawtext-timecode, hstack, vstack, 2x-speed) plus --custom --filter-string "..." for arbitrary -vf expressions. Use --dry-run to print the command without running.uv run ${CLAUDE_SKILL_DIR}/scripts/vfilter.py --preset scale-720p --input in.mp4 --output out.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/vfilter.py --preset watermark --input in.mp4 --watermark logo.png --output out.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/vfilter.py --preset hstack --inputs a.mp4,b.mp4 --output side.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/vfilter.py --custom --filter-string "crop=iw-200:ih:100:0,scale=-2:720" --input in.mp4 --output out.mp4
references/filters.md for exhaustive option tables, expression variables, -filter_complex label/map rules, drawtext escaping, and 50+ recipe snippets.scale=-2:720, not scale=-1:720. libx264 with YUV 4:2:0 will hard-fail on odd sizes.fontfile= throws "Fontconfig not found". Always specify a real path. macOS: /System/Library/Fonts/Supplemental/Arial.ttf. Linux: /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf. Windows: C\:/Windows/Fonts/arial.ttf (note the escaped colon).: separates filter params → escape inside text as \:. , separates filters → escape as \,. ' quotes the text → escape as \\\'' or wrap the whole arg in double quotes at the shell level. For % signs use \%.-vf cannot take multiple inputs. The moment you need [1:v], switch to -filter_complex.-filter_complex disables default stream selection. You must -map every output label you want muxed (-map "[v]" -map 0:a?), or ffmpeg will not pick them up.format=yuva420p on the overlay input: [1:v]format=yuva420p,scale=...[wm].setsar=1 fixes aspect metadata. Some sources (DV, DVD) have non-square pixels. After any scale you should append setsar=1 to force square-pixel output.scale=flags=lanczos matters when downscaling. Default is bicubic; lanczos is sharper for 1080p→720p. Upscaling: bicubic/lanczos similar; gauss for blur-friendly upscale.hstack/vstack require equal dimensions. Both inputs must match the stacking axis (same height for hstack, same width for vstack). Scale first.fps vs minterpolate. fps=30 drops/duplicates frames — cheap, no visual smoothing. minterpolate=fps=60 motion-interpolates new frames — expensive, but smooth.ffprobe -show_streams | grep field_order. yadif=1 sends one field per frame (keeps fps); yadif=0 merges fields (halves fps, often what you want for 29.97i → 29.97p).Input: main.mp4, logo.png (with alpha).
Steps: scale logo to 200px wide, overlay with 10px margin.
ffmpeg -i main.mp4 -i logo.png \
-filter_complex "[1:v]format=yuva420p,scale=200:-1[wm];[0:v][wm]overlay=W-w-10:H-h-10[v]" \
-map "[v]" -map 0:a? -c:v libx264 -crf 20 -c:a copy out.mp4
Input: any aspect ratio. Steps: fit inside 1920x1080, pad with black to center.
ffmpeg -i in.mp4 -vf \
"scale=1920:1080:force_original_aspect_ratio=decrease:flags=lanczos,\
pad=1920:1080:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1" \
-c:v libx264 -crf 18 -c:a copy out.mp4
Both inputs must share height. Normalize first.
ffmpeg -i a.mp4 -i b.mp4 -filter_complex \
"[0:v]scale=-2:720[a];[1:v]scale=-2:720[b];[a][b]hstack=inputs=2[v]" \
-map "[v]" -c:v libx264 -crf 20 out.mp4
Burns running timecode at top-left with semi-transparent box.
ffmpeg -i in.mp4 -vf \
"drawtext=fontfile=/System/Library/Fonts/Supplemental/Arial.ttf:\
timecode='00\:00\:00\:00':rate=25:fontsize=32:fontcolor=white:\
box=1:[email protected]:boxborderw=8:x=20:y=20" \
-c:v libx264 -crf 20 -c:a copy out.mp4
Note the \: inside the timecode= value — the colons are escaped so ffmpeg doesn't interpret them as parameter separators.
ffmpeg -i interlaced.mxf -vf "yadif=1,setsar=1" \
-c:v libx264 -crf 18 -preset slow -c:a copy progressive.mp4
Use yadif=0 if you actually want half the output framerate (merge fields, 50i → 25p).
Cause: scale=-1:720 produced an odd width, or you used a codec that demands even dimensions.
Solution: replace -1 with -2. Example: scale=-2:720.
Cause: your ffmpeg build lacks the filter or font system.
Solution: check ffmpeg -filters | grep drawtext. If present, pass fontfile=/absolute/path/to/font.ttf explicitly — do not rely on font=Arial.
Cause: -filter_complex defined [v] but you forgot -map "[v]", or you misspelled the label.
Solution: every bracketed label on the right side of the last filter must appear in a -map directive.
Cause: overlay input has alpha but no explicit pixel format, so it was negotiated to a format without alpha.
Solution: add format=yuva420p before overlay on the overlay chain: [1:v]format=yuva420p,scale=200:-1[wm].
Cause: inputs to hstack/vstack have different heights/widths.
Solution: scale both to a common dimension first. [0:v]scale=-2:720[a];[1:v]scale=-2:720[b];[a][b]hstack.
Cause: over-escaping. You only escape once at the filter-argument level.
Solution: for static text, use text='Hello\, World' (single-quoted, \, for commas). For timecodes, use the timecode= option instead of text=.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub damionrashford/media-os --plugin media-os110 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++.
Other plugins' skills for the same job