/media-os:ffmpeg-whip [whip-endpoint]from media-os
Publishes live audio/video to any WHIP endpoint via ffmpeg's whip muxer, enabling sub-second WebRTC streaming to platforms like Cloudflare, Mux, and Millicast.
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
WebRTC publish via ffmpeg's whip muxer (FFmpeg 7.0+). Sub-second glass-to-glass live delivery to any WHIP-compatible ingest (Cloudflare Stream, Mux, Millicast/Dolby.io, MediaMTX, self-hosted Pion/Janus).
Do NOT use for archival VOD (use HLS/DASH), 4K/high-bitrate (RTMP is more robust), or when the target only accepts RTMP.
WHIP landed in FFmpeg 7.0 (April 2024). Older builds do not have it at all — no flag or patch makes it work. Homebrew sometimes lags; check explicitly.
ffmpeg -version | head -1 # need "ffmpeg version 7.0" or higher
ffmpeg -muxers 2>/dev/null | grep -i whip # must print: E whip WHIP ...
ffmpeg -h muxer=whip # see all whip-specific options
If whip is absent: upgrade (brew upgrade ffmpeg, or build from source / grab a static build from johnvansickle.com / BtbN/FFmpeg-Builds).
Helper: uv run ${CLAUDE_SKILL_DIR}/scripts/whip.py check-build.
WebRTC codec support is much stricter than RTMP/HLS. Required:
| What | Required value |
|---|---|
| Video codec | libx264 (H.264). No HEVC, no VP9, no AV1. |
| H.264 profile | baseline (safest) or main. No B-frames. |
| GOP | -g 60 -keyint_min 60 -sc_threshold 0 (2s @ 30fps) |
| Tune | -tune zerolatency |
| Preset | veryfast or ultrafast (real-time CPU budget) |
| Pixel format | -pix_fmt yuv420p (mandatory) |
| Audio codec | libopus. No AAC. |
| Sample rate | -ar 48000 (Opus standard) |
| Channels | -ac 2 (stereo) or -ac 1 (mono) |
| Audio bitrate | -b:a 128k (96k–128k typical) |
| Video bitrate | 2500k @ 720p30, 4500k @ 1080p30, 6000k @ 1080p60 |
Constant bitrate is strongly recommended for WebRTC congestion control: -b:v X -maxrate X -bufsize 2X.
ffmpeg -re -i source.mp4 \
-c:v libx264 -profile:v baseline -preset veryfast -tune zerolatency \
-g 60 -keyint_min 60 -sc_threshold 0 \
-b:v 2500k -maxrate 2500k -bufsize 5000k -pix_fmt yuv420p \
-c:a libopus -b:a 128k -ar 48000 -ac 2 \
-f whip 'https://whip.example.com/endpoint?token=XYZ'
-re reads at real-time wall-clock rate — required when the input is a file and you want it to behave like a live feed. Omit -re for actual live capture (camera/screen/mic already arrive in real time).
ffmpeg -f avfoundation -framerate 30 -i "1:0" \
-c:v libx264 -profile:v baseline -preset veryfast -tune zerolatency \
-g 60 -keyint_min 60 -sc_threshold 0 \
-b:v 3000k -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p \
-c:a libopus -b:a 128k -ar 48000 -ac 2 \
-headers "Authorization: Bearer $TOKEN"$'\r\n' \
-f whip 'https://whip.example.com/endpoint'
Linux: swap -f avfoundation -i "1:0" for -f x11grab -i :0.0 -f pulse -i default.
Windows: swap for -f gdigrab -i desktop -f dshow -i audio="Mic".
See the ffmpeg-capture skill for platform-specific device indexes.
Most WHIP endpoints require Authorization: Bearer <token>. Pass via -headers:
-headers "Authorization: Bearer ${TOKEN}"$'\r\n'
The trailing \r\n matters — HTTP headers must be CRLF-terminated. Use ANSI-C $'\r\n' in bash/zsh.
| Platform | URL shape |
|---|---|
| Cloudflare Stream | https://customer-<id>.cloudflarestream.com/<SRTKey>/webRTC/publish |
| Mux | https://global-live.mux.com/api/whip/<stream-key> |
| Millicast / Dolby | https://director.millicast.com/api/whip/<stream-name> + Bearer header |
| MediaMTX (self) | http://localhost:8889/<path>/whip |
| Pion/Broadcast Box | http://localhost:8080/api/whip?streamKey=<key> |
See references/whip.md for per-platform auth details.
Replace -c:v libx264 -preset veryfast -tune zerolatency with:
-c:v h264_videotoolbox -realtime 1-c:v h264_nvenc -preset p1 -tune ll -zerolatency 1-c:v h264_qsv -preset veryfast -low_power 1Still keep -profile:v baseline, -g 60 -keyint_min 60, -pix_fmt yuv420p.
Run with -loglevel debug to see the SDP offer/answer exchange:
ffmpeg -loglevel debug [...full command...] 2>&1 | grep -Ei 'whip|sdp|ice|stun|http'
Success looks like:
HTTP/1.1 201 Created with a Location: header (the WHIP resource URL).a=candidate: lines.Play back on the same platform's WHEP endpoint from a browser — ffplay cannot consume WHIP/WHEP. For Cloudflare, open the dashboard; for MediaMTX open http://localhost:8889/<path>; for Pion/BroadcastBox use their web player.
To stop the publish cleanly, Ctrl-C — ffmpeg will DELETE the resource URL.
scripts/whip.py check-build — reports ffmpeg version and whether the whip muxer is present.scripts/whip.py publish — builds the full publish command for a file input with sensible WebRTC encoder defaults. --dry-run prints the command without executing.scripts/whip.py publish-screen — same for platform screen + mic capture (picks avfoundation / x11grab / gdigrab by OS).Both publish subcommands accept --bitrate, --resolution, --fps, --token, --verbose, --dry-run.
references/whip.md for the WHIP handshake, per-platform URL patterns, auth schemes, and RTMP/HLS comparison.ffmpeg -muxers | grep whip is the gate.-profile:v baseline guarantees this; main also works for most receivers.-g 60 -keyint_min 60 -sc_threshold 0 (or 30 for 15fps). Variable-GOP breaks WebRTC jitter buffer.-pix_fmt yuv420p is mandatory. Not yuv422p, not yuv444p, not NV12.-re for file inputs, NOT for live capture. Using -re on a live camera double-rate-limits and desyncs.-headers: end with $'\r\n', not \n, or the server rejects the header.Location:. ffmpeg sends DELETE to the resource URL on shutdown.ffplay <whip-url> does not work.veryfast/ultrafast on CPU, or you drop frames under real-time.Unknown output format: whipCause: ffmpeg version < 7.0 or built without WHIP.
Fix: Upgrade (brew upgrade ffmpeg) or install a 7.0+ static build.
HTTP error 401 UnauthorizedCause: Missing or malformed Bearer token.
Fix: Add -headers "Authorization: Bearer $TOKEN"$'\r\n' with the correct CRLF terminator. Verify the token with curl -v -X POST -H "Authorization: Bearer $TOKEN" <whip-url>.
ICE connection failed / no video arrivesCause: NAT traversal failed. STUN alone is not enough behind symmetric NAT. Fix: Use a WHIP provider that proxies media (Cloudflare, Mux) or deploy a TURN server and use a ffmpeg build that supports the muxer's TURN options. Test from a different network.
non-monotonic DTS, stream stalls after a few secondsCause: B-frames or variable GOP slipped in.
Fix: Force -profile:v baseline -bf 0 -g 60 -keyint_min 60 -sc_threshold 0.
Could not find codec parameters for streamCause: Wrong audio codec (AAC) or wrong pixel format.
Fix: -c:a libopus -ar 48000 and -pix_fmt yuv420p.
Cause: Profile mismatch — receiver can't decode. Usually high profile sent.
Fix: Explicitly -profile:v baseline (or main) and -level 4.1.
ffmpeg -loglevel trace -re -i test.mp4 [encoder flags] -f whip '<url>' 2>&1 \
| grep -Ei 'http|sdp|ice|candidate|dtls|offer|answer'
On the receiving side, open chrome://webrtc-internals in the browser playing the WHEP stream to see inbound RTP stats, packet loss, jitter, and the negotiated codecs.
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.
Other plugins' skills for the same job