/media-os:ffmpeg-streaming [protocol] [input]from media-os
Packages and streams media with ffmpeg: HLS, MPEG-DASH, RTMP push to YouTube/Twitch, SRT, RTSP, RTP, UDP, and tee muxer for multi-output.
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
| Protocol | Muxer / -f | Typical use | Latency |
|---|---|---|---|
| RTMP | -f flv to rtmp://… | Ingest to YouTube/Twitch/FB | 2–5 s |
| HLS | -f hls → .m3u8 + segments | Browser / iOS VOD + Live | 6–20 s (std), 3–7 s (LL) |
| DASH | -f dash → .mpd | Browser / Android | 6–20 s (std), 3–7 s (LL) |
| SRT | -f mpegts over srt://… | Contribution / IP backhaul | 120–400 ms |
| RTSP | -f rtsp to rtsp://… | IP cameras / private nets | ~200 ms |
| RTP | -f rtp to rtp://host:port | Low-level unicast/multicast | ~100 ms |
| UDP | -f mpegts to udp://… | Broadcast contribution | ~100 ms |
| Tee | `-f tee '[f=…]out1 | [f=…]out2'` | One encode → many destinations |
Decide one primary protocol first. Pick tee only after the single-sink command works.
Live ingests demand a strict GOP and fast encoder. These flags are mandatory for RTMP/HLS/DASH live.
-c:v libx264 -preset veryfast -tune zerolatency \
-b:v 6000k -maxrate 6000k -bufsize 12000k \
-pix_fmt yuv420p \
-g 60 -keyint_min 60 -sc_threshold 0 \
-c:a aac -b:a 160k -ar 44100 -ac 2
Rules of thumb:
-g = fps × segment_time (30 fps × 2 s = -g 60). Force with -keyint_min equal to -g.-sc_threshold 0 disables scene-cut keyframes → consistent GOP boundaries required for clean HLS/DASH segmentation.-tune zerolatency only valid for libx264/libx265; drops B-frames and look-ahead.-re on the input. Do NOT use -re with a real live camera.ffmpeg -i in.mp4 \
-c:v libx264 -preset veryfast -tune zerolatency \
-b:v 6000k -maxrate 6000k -bufsize 12000k \
-g 60 -keyint_min 60 -sc_threshold 0 -pix_fmt yuv420p \
-c:a aac -b:a 160k -ar 44100 \
-f flv rtmp://a.rtmp.youtube.com/live2/STREAM-KEY
Ingests: YouTube rtmp://a.rtmp.youtube.com/live2/KEY, Twitch rtmp://live.twitch.tv/app/KEY, Facebook rtmps://live-api-s.facebook.com:443/rtmp/KEY. rtmps:// needs an ffmpeg built with OpenSSL/GnuTLS.
ffmpeg -i in.mp4 \
-c:v libx264 -b:v 2500k -c:a aac -b:a 128k \
-f hls -hls_time 6 -hls_playlist_type vod \
-hls_segment_filename 'seg_%03d.ts' out.m3u8
ffmpeg -i rtmp://localhost/live/stream \
-c:v libx264 -preset veryfast -tune zerolatency \
-b:v 3000k -g 60 -keyint_min 60 -sc_threshold 0 \
-c:a aac -b:a 128k \
-f hls -hls_time 4 -hls_list_size 6 \
-hls_flags delete_segments+append_list \
out.m3u8
Use -hls_playlist_type event when you want the playlist to grow but never drop segments. Leave -hls_playlist_type unset (or event) to allow delete_segments.
-hls_segment_type fmp4 \
-hls_fmp4_init_filename init.mp4 \
-hls_segment_filename 'seg_%05d.m4s'
ffmpeg -i in.mp4 \
-filter_complex "[0:v]split=3[v1][v2][v3];
[v1]scale=w=1920:h=1080[v1out];
[v2]scale=w=1280:h=720[v2out];
[v3]scale=w=854:h=480[v3out]" \
-map "[v1out]" -c:v:0 libx264 -b:v:0 5000k -maxrate:v:0 5350k -bufsize:v:0 7500k \
-map "[v2out]" -c:v:1 libx264 -b:v:1 2800k -maxrate:v:1 3000k -bufsize:v:1 4200k \
-map "[v3out]" -c:v:2 libx264 -b:v:2 1400k -maxrate:v:2 1500k -bufsize:v:2 2100k \
-map a:0 -map a:0 -map a:0 \
-c:a aac -b:a 128k -ac 2 \
-preset veryfast -g 60 -keyint_min 60 -sc_threshold 0 \
-f hls -hls_time 4 -hls_playlist_type vod \
-hls_segment_filename 'stream_%v/seg_%03d.ts' \
-master_pl_name master.m3u8 \
-var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2" \
'stream_%v/index.m3u8'
-var_stream_map groups are space-separated; each group lists comma-separated stream indexes for that rendition (v:N,a:N). %v in filenames expands to the variant index.
ffmpeg -i in.mp4 \
-c:v libx264 -b:v 2500k -g 60 -keyint_min 60 -sc_threshold 0 \
-c:a aac -b:a 128k \
-f dash -seg_duration 4 -use_template 1 -use_timeline 1 \
-init_seg_name 'init-$RepresentationID$.m4s' \
-media_seg_name 'chunk-$RepresentationID$-$Number%05d$.m4s' \
manifest.mpd
# Listener (server) — wait for a caller to connect
ffmpeg -re -i in.mp4 -c copy \
-f mpegts 'srt://0.0.0.0:9000?mode=listener&latency=120000'
# Caller (push) with passphrase (AES-128)
ffmpeg -re -i in.mp4 -c copy \
-f mpegts 'srt://receiver.example.com:9000?mode=caller&passphrase=secretpass123&pbkeylen=16&latency=120000'
latency is in microseconds (120000 = 120 ms). pbkeylen = 16/24/32 for AES-128/192/256. Passphrase must be 10–79 chars.
ffmpeg -i in.mp4 \
-c:v libx264 -preset veryfast -tune zerolatency \
-b:v 4500k -g 60 -keyint_min 60 -sc_threshold 0 \
-c:a aac -b:a 128k \
-map 0:v -map 0:a \
-f tee '[f=flv]rtmp://a.rtmp.youtube.com/live2/KEY|[f=hls:hls_time=4:hls_list_size=6:hls_flags=delete_segments]out.m3u8|[f=mpegts]archive.ts'
Escape | inside shell strings by quoting the whole tee spec. Per-sink options go inside [f=…:opt=val:opt=val].
frame=, fps=, bitrate=, speed=. speed must be ≥ 1× for live..m3u8/.mpd in a player (ffplay, hls.js, dash.js, Safari).lost grows, raise latency.scripts/stream.py — subcommands: rtmp, hls-vod, hls-live, hls-abr, dash, srt-listener, srt-caller, tee. Stdlib only; prints the ffmpeg command, supports --dry-run and --verbose.uv run ${CLAUDE_SKILL_DIR}/scripts/stream.py <subcommand> --input INPUT [flags]
--dry-run first to print the command; run again without it to execute.references/muxers.md for full option tables (hls, dash, tee, rtmp, srt, rtsp, udp, rtp), latency ladder, platform ingest URLs, keyframe math, and LL-HLS notes.-re is required when streaming a file in real-time (live simulation); NEVER use it on a true live camera/encoder input.-g 60 -keyint_min 60. Set both; -g alone allows variable GOP.-sc_threshold 0 is REQUIRED on libx264 for HLS/DASH — otherwise a scene cut inserts an extra keyframe and segments misalign.-tune zerolatency is libx264/libx265 only. It disables B-frames + look-ahead; do not use for VOD.-g 60). Twitch and Facebook are the same.-f flv. AAC-LC only; sample rate 44.1 or 48 kHz; stereo.-hls_flags delete_segments only works when -hls_playlist_type is unset or event, never vod.-c:v:0, -b:v:0, -maxrate:v:0, -bufsize:v:0, etc., one set per rendition.-var_stream_map takes space-separated groups, each v:N,a:N referencing the output map indexes, not input.-use_template 1 -use_timeline 1. Leave both off only for static MPDs you hand-edit.latency is microseconds (120000 = 120 ms). Minimum useful value ≈ 2 × RTT.| separator must be inside quotes to avoid being parsed as a shell pipe.-flush_packets 1 (default) is fine for RTMP; set -flush_packets 0 only if a specific CDN asks for it — increases latency.-movflags +faststart is for MP4 VOD only. It is irrelevant for live HLS/DASH/RTMP/SRT.EXT-X-PART) are NOT produced by upstream ffmpeg. ffmpeg emits standard HLS with short -hls_time (e.g. 2 s) — true LL-HLS requires an external packager.Input: intro.mp4, stream key abcd-1234-efgh-5678.
uv run scripts/stream.py rtmp --input intro.mp4 \
--url rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678 \
--bitrate 6000k --preset veryfast
Result: YouTube Studio shows "Live" within ~20 s.
uv run scripts/stream.py hls-vod --input movie.mp4 --outdir out/ --segments 6
Result: out/index.m3u8 + out/seg_000.ts, seg_001.ts, …
uv run scripts/stream.py hls-abr --input master.mov --outdir abr/ \
--ladder "1080p=5000k 720p=2800k 480p=1400k"
Result: abr/master.m3u8 master + abr/stream_0/index.m3u8, stream_1/…, stream_2/….
uv run scripts/stream.py srt-caller --input live.ts \
--url 'srt://receiver.example.com:9000?mode=caller&passphrase=secretpass123&pbkeylen=16&latency=120000'
uv run scripts/stream.py tee --input cam.mp4 \
--outputs '[f=flv]rtmp://a.rtmp.youtube.com/live2/KEY|[f=hls:hls_time=4:hls_list_size=6:hls_flags=delete_segments]out.m3u8|[f=mpegts]archive.ts'
Output #0, flv, to 'rtmp://...': could not find tag for codec ... in stream #0Cause: container/codec mismatch. RTMP/FLV only carries H.264 + AAC.
Solution: add -c:v libx264 -c:a aac. Never pass -c copy to an RTMP target unless the input is already H.264/AAC.
Non-monotonous DTS floodCause: re-muxing a live source with -c copy when input has bad timestamps.
Solution: re-encode (-c:v libx264 -c:a aac) or add -fflags +genpts.
#EXT-X-DISCONTINUITY on every segmentCause: GOP not aligned to segment duration. Scene-cut keyframes or -g != fps × hls_time.
Solution: set -g $((fps * hls_time)) -keyint_min $((fps * hls_time)) -sc_threshold 0.
Connection setup failure: connection time outCause: listener not reachable, wrong mode, or latency too low for the link RTT.
Solution: verify mode=listener vs mode=caller, open UDP port 9000, raise latency=400000 for sat links.
Cause: by default tee propagates sink errors.
Solution: add onfail=ignore per sink: [f=flv:onfail=ignore]rtmp://….
Cause: wrong ingest URL, missing -f flv, or GOP > 4 s.
Solution: confirm rtmp://a.rtmp.youtube.com/live2/KEY, use -f flv, ensure keyframes every 2 s (-g 60 at 30 fps).
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