/media-os:ffmpeg-stabilize [input]from media-os
Stabilizes shaky video via ffmpeg using 2-pass vidstabdetect+vidstabtransform, single-pass deshake, deshake_opencl, or rolling-shutter correction.
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
deshake → Examplesdeshake_opencl → Examplestripod=N → references/vidstab.mdffmpeg -filters 2>/dev/null | grep -i vidstab
Must show both vidstabdetect and vidstabtransform. If missing, either install a Homebrew build (brew install ffmpeg — includes --enable-libvidstab since late 2019), or fall back to deshake (builtin, always available).
scripts/stabilize.py check-build does this check programmatically.
ffmpeg -i in.mp4 \
-vf vidstabdetect=shakiness=5:accuracy=15:result=transforms.trf \
-f null -
transforms.trf (plain-text, one line per frame with dx/dy/rot/zoom).-f null - discards the video output — we only want the sidecar file.shakiness: 1 (mild) to 10 (extreme), default 5.accuracy: 1 (fast) to 15 (max), default 15. Keep at 15 unless iterating.ffmpeg -i in.mp4 \
-vf "vidstabtransform=input=transforms.trf:zoom=0:smoothing=30:crop=black,unsharp=5:5:0.8:3:3:0.4" \
-c:v libx264 -crf 18 -preset slow \
-c:a copy out.mp4
smoothing=30 ≈ 1 second at 30 fps — good default.crop=black leaves black borders where frame was pushed; crop=keep repeats prior edge pixels.unsharp=5:5:0.8:3:3:0.4 restores sharpness lost to bilinear interpolation.-c:a copy passes audio through; re-encode is required for video.Option A — fixed zoom (percent):
vidstabtransform=input=transforms.trf:zoom=5:smoothing=30:crop=black
Option B — automatic optimal zoom (recommended for heavy shake):
vidstabtransform=input=transforms.trf:optzoom=1:smoothing=30:crop=black
Option C — adaptive optzoom with zoom speed cap:
vidstabtransform=input=transforms.trf:optzoom=2:zoomspeed=0.25:smoothing=30:crop=black
ffplay out.mp4 # visual check
ffprobe -v error -show_entries stream=codec_name,width,height,r_frame_rate out.mp4
For A/B compare:
ffmpeg -i in.mp4 -i out.mp4 -filter_complex hstack -c:v libx264 -crf 20 compare.mp4
scripts/stabilize.py stabilize — runs both passes end-to-end, manages transforms.trf in a tempdir.scripts/stabilize.py deshake — single-pass fallback.scripts/stabilize.py check-build — reports vid.stab availability.uv run ${CLAUDE_SKILL_DIR}/scripts/stabilize.py stabilize --input in.mp4 --output out.mp4 --sharpen --zoom auto
uv run ${CLAUDE_SKILL_DIR}/scripts/stabilize.py deshake --input in.mp4 --output out.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/stabilize.py check-build
references/vidstab.md for full option tables, tripod mode, recipe gallery, and the build-from-source note.--enable-libvidstab. Homebrew's ffmpeg has included it for years; static Zeranoe-style builds sometimes don't. Always verify with Step 1 first.deshake for genuinely shaky content. deshake is a last resort.transforms.trf is plain text — safe to inspect, diff, or back up.shakiness is 1–10 (5 typical). accuracy is 1–15 (15 = slowest / best).smoothing is in frames, not seconds. 30 ≈ 1s at 30 fps. Too high → jelly/floaty feel. Too low → residual shake bleeds through.zoom=N is percent. Use optzoom=1 for automatic; optzoom=2:zoomspeed=... for gentler adaptive.crop=black produces borders that wiggle at clip edges. Compensate with zoom / optzoom, or post-crop.-c:v copy) is not possible — the filter requires decoded frames. Re-encode is mandatory.unsharp after the transform, not before. Pre-sharpening amplifies noise into the motion estimator.vidstabtransform with deshake — pick one.deshake_opencl requires -init_hw_device opencl before the -i. Missing it → filter not found.-f null - writes NOTHING to stdout/stderr (except progress). The transforms.trf file IS being written — don't assume it failed.-vcodec copy does not work — vidstabdetect needs decoded frames.-fflags +genpts on the input side of pass 2.# Pass 1
ffmpeg -i phone.mp4 -vf vidstabdetect=shakiness=5:accuracy=15:result=phone.trf -f null -
# Pass 2
ffmpeg -i phone.mp4 \
-vf "vidstabtransform=input=phone.trf:smoothing=30:optzoom=1:crop=black,unsharp=5:5:0.8:3:3:0.4" \
-c:v libx264 -crf 18 -preset slow -c:a copy phone_stable.mp4
ffmpeg -i wild.mp4 -vf vidstabdetect=shakiness=10:accuracy=15:result=wild.trf -f null -
ffmpeg -i wild.mp4 \
-vf "vidstabtransform=input=wild.trf:smoothing=60:optzoom=2:zoomspeed=0.3:crop=black,unsharp=5:5:0.8:3:3:0.4" \
-c:v libx264 -crf 18 -preset slow -c:a copy wild_stable.mp4
ffmpeg -i talk.mp4 -vf vidstabdetect=shakiness=3:result=talk.trf -f null -
ffmpeg -i talk.mp4 \
-vf "vidstabtransform=input=talk.trf:tripod=1:smoothing=0:crop=keep,unsharp=5:5:0.8:3:3:0.4" \
-c:v libx264 -crf 18 -c:a copy talk_locked.mp4
ffmpeg -i in.mp4 -vf deshake -c:v libx264 -crf 18 out.mp4
ffmpeg -init_hw_device opencl=ocl:0.0 -filter_hw_device ocl \
-i in.mp4 \
-vf "format=nv12,hwupload,deshake_opencl,hwdownload,format=yuv420p" \
-c:v libx264 -crf 18 out.mp4
No such filter: 'vidstabdetect'Cause: ffmpeg built without --enable-libvidstab.
Solution: brew install ffmpeg (macOS) or rebuild; use deshake as a fallback.
Unable to open file 'transforms.trf' for readingCause: pass 2 run from a different cwd than pass 1, or pass 1 silently failed.
Solution: pass absolute paths to result= and input=; verify the file exists and is non-empty.
Cause: crop=black + zoom=0.
Solution: add optzoom=1 or zoom=5; or post-crop with crop=iw*0.95:ih*0.95.
Cause: smoothing too high.
Solution: drop to smoothing=15 or smoothing=10.
Cause: smoothing too low, or shakiness in pass 1 underestimated the motion.
Solution: rerun pass 1 with shakiness=8–10, rerun pass 2 with smoothing=60.
Cause: rolling shutter skew, not camera shake. vid.stab can't fix the skew itself. Solution: pre-process with Gyroflow / GoPro Player to correct rolling shutter, then stabilize.
Not hung — -f null - suppresses the output stream. Watch the frame= progress line on stderr; transforms.trf is being written.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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