/media-os:ffmpeg-audio-filter [operation] [input]from media-os
Applies audio filters with ffmpeg: loudnorm for EBU R128 loudness normalization, volume adjustment, EQ, speed change, audio mixing, channel remapping, silence trim, and fades.
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
volume filter → Step 2atempo (chain if outside 0.5–2.0) → Step 2amix with aresample + aformat guards → Step 2pan with explicit channel map → Step 2silenceremove → Step 2ebur128 or astats → Step 3Loudness mastering (perceptual) → 2-pass loudnorm. Single-pass is dynamic
and can pump; 2-pass uses measured stats for a clean linear gain.
Peak normalize (simple, not perceptual) → measure peak with astats or
volumedetect, then apply volume=<gain>dB.
Speed/tempo change → atempo (keeps pitch; range 0.5–100 per instance,
chain two atempo=0.5 for 0.25x). Pitch shift → asetrate+aresample
or rubberband (rare build).
Mix/merge → amix (sums signals, ideal for music+voice); amerge
(interleaves channels, e.g. L+R mono files → stereo).
Channel remap → pan with an explicit layout expression.
Verify → ebur128 filter (loudness meter) or astats (peak/RMS/DC).
Use -af when there is a single audio input. Use -filter_complex
whenever more than one input feeds the graph (amix, amerge,
sidechaincompress).
Pass 1 — measure (writes JSON to stderr):
ffmpeg -hide_banner -i in.wav \
-af loudnorm=I=-16:LRA=11:TP=-1.5:print_format=json \
-f null -
Parse input_i, input_lra, input_tp, input_thresh, target_offset
from the JSON block at the end of stderr.
Pass 2 — apply (linear gain, clean):
ffmpeg -i in.wav -af \
loudnorm=I=-16:LRA=11:TP=-1.5:\
measured_I=<input_i>:measured_LRA=<input_lra>:\
measured_TP=<input_tp>:measured_thresh=<input_thresh>:\
offset=<target_offset>:linear=true:print_format=summary \
-ar 48000 out.wav
scripts/afilter.py --two-pass handles both passes and JSON parsing.
ffmpeg -i in.wav -af dynaudnorm=f=150:g=15:p=0.95 out.wav
-af volume=0.5 # linear (half amplitude)
-af volume=-6dB # decibel
-af volume=0.8:precision=float
-af atempo=1.5 # 1.5x
-af atempo=0.5,atempo=0.5 # 0.25x (chain; single-instance limit 0.5–100)
-af asetrate=48000*1.06,aresample=48000,atempo=1/1.06
# pitch up ~1 semitone, keep duration
ffmpeg -i voice.wav -i music.wav -filter_complex \
"[0]aresample=48000,aformat=channel_layouts=stereo[a0]; \
[1]aresample=48000,aformat=channel_layouts=stereo,volume=0.25[a1]; \
[a0][a1]amix=inputs=2:duration=longest:dropout_transition=0:normalize=0[aout]" \
-map "[aout]" out.wav
normalize=0 is critical — default 1 scales by 1/N which is almost
never what you want.
ffmpeg -i L.wav -i R.wav -filter_complex \
"[0][1]amerge=inputs=2,pan=stereo|c0=c0|c1=c1[aout]" \
-map "[aout]" stereo.wav
-af pan=mono|c0=0.5*c0+0.5*c1 # stereo → mono
-af "pan=stereo|c0=c0|c1=c1" # passthrough stereo
-af "pan=stereo|c0=0.5*FL+0.707*FC+0.5*BL+0.5*SL| \
c1=0.5*FR+0.707*FC+0.5*BR+0.5*SR" # 5.1 → stereo downmix
-af silenceremove=start_periods=1:start_duration=0.5:start_threshold=-50dB: \
stop_periods=-1:stop_duration=0.5:stop_threshold=-50dB
-af "afade=t=in:st=0:d=1,afade=t=out:st=58:d=2"
-af "highpass=f=80,lowpass=f=16000,equalizer=f=3000:t=q:w=1.5:g=3,bass=g=2,treble=g=1"
After any loudness operation, re-measure:
ffmpeg -hide_banner -nostats -i out.wav -af ebur128=peak=true -f null - 2>&1 | tail -20
Look at I: (integrated LUFS), LRA: (loudness range), Peak: (dBTP).
They should match the target within ~0.5 LU.
For peak/RMS/DC offset:
ffmpeg -i out.wav -af astats=metadata=1:reset=1 -f null - 2>&1 | grep -E "RMS|Peak|DC"
Channel layout / codec sanity:
ffprobe -v error -select_streams a -show_entries stream=codec_name,sample_rate,channels,channel_layout -of json out.wav
scripts/afilter.py — presets for loudnorm (yt/podcast/ebu), peak normalize, 2-input mix, speed, mono downmix, simple denoise. Implements the 2-pass loudnorm measure→apply flow (--two-pass).# 2-pass loudnorm to YouTube target
uv run ${CLAUDE_SKILL_DIR}/scripts/afilter.py loudnorm-yt \
--input in.wav --output out.wav --two-pass --verbose
# mix voice over music
uv run ${CLAUDE_SKILL_DIR}/scripts/afilter.py mix-two \
--inputs voice.wav music.wav --output mix.wav
# speed up 2x (chain-safe)
uv run ${CLAUDE_SKILL_DIR}/scripts/afilter.py speed \
--input in.wav --output out.wav --factor 2.0
# preview command without running
uv run ${CLAUDE_SKILL_DIR}/scripts/afilter.py loudnorm-podcast \
--input in.wav --output out.wav --two-pass --dry-run
references/filters.md for full option tables (loudnorm, dynaudnorm, acompressor, compand, equalizer, aresample, amix, pan, silenceremove), channel-layout names, platform loudness targets, and recipes (ducking, de-ess, click removal).loudnorm single-pass is dynamic, not linear. It can pump and distort transients. Always run 2-pass for masters — measure first, then apply with measured_* + linear=true.linear=true only works when every measured_* value is supplied. Miss one → falls back to dynamic silently.-af is single-input. Any graph with amix, amerge, or sidechaincompress must use -filter_complex and -map "[aout]".amix vs amerge: amix sums samples (music + voice mix). amerge interleaves channels (two mono files → one stereo stream). Mixing these up produces silent outputs or wrong channel counts.amix. Insert aresample=48000 on every input before mixing.amix. Insert aformat=channel_layouts=stereo (or mono) per input.amix default normalize=1 scales output by 1/N. Almost always wrong — set normalize=0 and handle gain yourself.volume is NOT loudness. Linear/dB gain only — perceptual targets need loudnorm.atempo is capped 0.5–100.0 per instance. For 0.25x chain atempo=0.5,atempo=0.5; for 200x chain atempo=10,atempo=10,atempo=2.asetrate alone changes pitch. If you want speed without pitch, use atempo. asetrate+aresample resets SR but pitch is still shifted — combine with atempo to compensate.rubberband filter requires a custom ffmpeg build. Check ffmpeg -filters | grep -i rubberband. Most distro/Homebrew builds do not include it.-ar on output ≠ aresample filter. -ar is a global output option; filter-graph resampling must use aresample explicitly inside the graph.silenceremove uses stop_periods=-1 (negative) to remove every silent region, not just the first.loudnorm writes JSON to stderr, mixed with progress lines. Parse the last {...} block, not the whole stream.references/filters.md before delivery.# Pass 1 — measure
ffmpeg -hide_banner -i ep01.wav \
-af loudnorm=I=-16:LRA=11:TP=-1.5:print_format=json -f null - 2>measure.txt
# Pass 2 — apply (values plugged in from measure.txt JSON block)
ffmpeg -i ep01.wav -af \
"loudnorm=I=-16:LRA=11:TP=-1.5:measured_I=-21.3:measured_LRA=8.2:\
measured_TP=-4.1:measured_thresh=-31.5:offset=-0.7:linear=true:print_format=summary" \
-ar 48000 -c:a pcm_s24le ep01_norm.wav
# Verify
ffmpeg -i ep01_norm.wav -af ebur128=peak=true -f null - 2>&1 | tail -10
ffmpeg -i voice.wav -i music.wav -filter_complex \
"[0:a]asplit=2[vox][sc]; \
[1:a][sc]sidechaincompress=threshold=-24dB:ratio=8:attack=5:release=250[ducked]; \
[vox][ducked]amix=inputs=2:duration=longest:normalize=0[aout]" \
-map "[aout]" out.wav
ffmpeg -i surround.wav -af \
"pan=stereo|c0=0.5*FL+0.707*FC+0.5*BL+0.5*SL|\
c1=0.5*FR+0.707*FC+0.5*BR+0.5*SR" -c:a pcm_s16le stereo.wav
ffmpeg -i raw.wav -af \
"silenceremove=start_periods=1:start_duration=0.3:start_threshold=-50dB:\
stop_periods=-1:stop_duration=0.5:stop_threshold=-50dB" trimmed.wav
ffmpeg -i in.wav -af atempo=0.5,atempo=0.5 slow.wav
Cause: inputs have different sample rates or channel layouts. Solution: pre-normalize each input:
[0]aresample=48000,aformat=channel_layouts=stereo[a0];
[1]aresample=48000,aformat=channel_layouts=stereo[a1];
[a0][a1]amix=inputs=2:normalize=0[aout]
Older ffmpeg (<5.1) capped atempo at 2.0. Chain multiple instances:
atempo=2.0,atempo=2.0 for 4x. Modern builds go to 100.
Cause: single-pass mode (dynamic). Either you did not supply all
measured_* values, or linear=true was omitted. Double-check every
field from pass 1 JSON is present in pass 2.
Cause: ffmpeg built without librubberband. Use atempo (keeps pitch)
or asetrate (changes pitch) instead, or install a build with
rubberband (e.g. brew install ffmpeg usually does NOT include it;
build from source with --enable-librubberband).
Cause: pan expression referenced a channel that does not exist in
the layout (e.g. BL on a stereo source). Use ffprobe to confirm
input channel_layout before writing the pan map.
Cause: default normalize=1 scales by 1/N. Add :normalize=0.
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