plugins/ffmpeg-platforms/skills/ffmpeg-streaming/SKILL.md
Complete live streaming and protocol system for FFmpeg 7.1 LTS and 8.0.1 (latest stable, released 2025-11-20). PROACTIVELY activate for: (1) RTMP streaming to Twitch/YouTube/Facebook, (2) HLS output and adaptive bitrate (ABR), (3) DASH streaming setup, (4) Low-latency streaming (LL-HLS, LL-DASH), (5) SRT protocol configuration, (6) WebRTC/WHIP sub-second latency (FFmpeg 8.0+), (7) Protocol conversion (RTMP to HLS), (8) Multi-destination streaming, (9) nginx-rtmp integration, (10) Docker streaming services. Provides: Platform-specific stream commands, ABR ladder examples, encryption setup, latency optimization, WHIP authentication, production patterns. Ensures: Reliable live streaming with optimal quality and latency.
npx skillsauth add JosiahSiegel/claude-plugin-marketplace ffmpeg-streamingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
MANDATORY: Always Use Backslashes on Windows for File Paths
When using Edit or Write tools on Windows, you MUST use backslashes (\) in file paths, NOT forward slashes (/).
| Protocol | Latency | Output Format | Best For |
|----------|---------|---------------|----------|
| RTMP | 2-5s | -f flv rtmp://... | Twitch, YouTube ingest |
| HLS | 10-30s | -f hls output.m3u8 | Web playback, CDN |
| LL-HLS | 2-5s | -hls_flags low_latency | Low-latency web |
| SRT | <1s | -f mpegts srt://... | Reliable contribution |
| DASH | 10-30s | -f dash output.mpd | ABR streaming |
| Platform | Ingest URL |
|----------|------------|
| Twitch | rtmp://live.twitch.tv/app/{key} |
| YouTube | rtmp://a.rtmp.youtube.com/live2/{key} |
| Facebook | rtmps://live-api-s.facebook.com:443/rtmp/{key} |
Use for live streaming workflows:
Complete guide to live streaming with FFmpeg covering RTMP, HLS, DASH, SRT, and WebRTC protocols.
Current Latest: FFmpeg 8.0.1 (released 2025-11-20) - Check with ffmpeg -version
| Protocol | Latency | Compatibility | Security | Use Case | |----------|---------|---------------|----------|----------| | RTMP | 1-5s | Legacy, ingestion | TLS (RTMPS) | Stream ingestion | | HLS | 6-30s | Universal | AES-128 | CDN delivery | | DASH | 6-30s | Wide | DRM-ready | ABR streaming | | LL-HLS | 2-4s | Apple/modern | AES-128 | Low-latency | | LL-DASH | 2-4s | Modern browsers | DRM-ready | Low-latency | | SRT | <1s | Growing | AES-128/256 | Contribution | | WebRTC | <0.5s | Browsers | DTLS/SRTP | Real-time | | WHIP | <1s | Emerging | TLS | WebRTC ingestion |
# Stream to RTMP server
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 6000k \
-c:a aac -b:a 128k \
-f flv rtmp://server/live/stream_key
# Linux webcam
ffmpeg -f v4l2 -i /dev/video0 \
-f alsa -i default \
-c:v libx264 -preset ultrafast -tune zerolatency -b:v 2500k \
-c:a aac -b:a 128k \
-f flv rtmp://server/live/stream_key
# macOS webcam
ffmpeg -f avfoundation -framerate 30 -i "0:0" \
-c:v libx264 -preset ultrafast -tune zerolatency -b:v 2500k \
-c:a aac -b:a 128k \
-f flv rtmp://server/live/stream_key
# Windows screen capture
ffmpeg -f gdigrab -framerate 30 -i desktop \
-c:v libx264 -preset ultrafast -tune zerolatency -b:v 3000k \
-c:a aac -b:a 128k \
-f flv rtmp://server/live/stream_key
# NVIDIA NVENC
ffmpeg -re -i input.mp4 \
-c:v h264_nvenc -preset p3 -tune ll -zerolatency 1 -b:v 6000k \
-c:a aac -b:a 128k \
-f flv rtmp://server/live/stream_key
# Intel QSV
ffmpeg -re -init_hw_device qsv=hw -filter_hw_device hw \
-i input.mp4 \
-c:v h264_qsv -preset fast -b:v 6000k \
-c:a aac -b:a 128k \
-f flv rtmp://server/live/stream_key
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 3000k \
-c:a aac -b:a 128k \
-f flv rtmps://secure-server/live/stream_key
# Twitch
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 6000k -maxrate 6000k -bufsize 12000k \
-g 60 -keyint_min 60 \
-c:a aac -b:a 160k -ar 44100 \
-f flv rtmp://live.twitch.tv/app/YOUR_STREAM_KEY
# YouTube
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k \
-g 60 -keyint_min 60 \
-c:a aac -b:a 128k -ar 44100 \
-f flv rtmp://a.rtmp.youtube.com/live2/YOUR_STREAM_KEY
# Facebook
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 4000k -maxrate 4000k -bufsize 8000k \
-g 60 \
-c:a aac -b:a 128k -ar 44100 \
-f flv rtmps://live-api-s.facebook.com:443/rtmp/YOUR_STREAM_KEY
# Create HLS stream
ffmpeg -i input.mp4 \
-c:v libx264 -c:a aac \
-hls_time 6 \
-hls_list_size 0 \
-hls_segment_filename "segment_%03d.ts" \
playlist.m3u8
# Live HLS with rolling window
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 3000k \
-c:a aac -b:a 128k \
-hls_time 4 \
-hls_list_size 10 \
-hls_flags delete_segments \
-hls_segment_filename "live_%03d.ts" \
live.m3u8
# Multi-bitrate HLS
ffmpeg -i input.mp4 \
-filter_complex "[0:v]split=3[v1][v2][v3]; \
[v1]scale=1920:1080[v1out]; \
[v2]scale=1280:720[v2out]; \
[v3]scale=854: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 2996k -bufsize:v:1 4200k \
-map "[v3out]" -c:v:2 libx264 -b:v:2 1400k -maxrate:v:2 1498k -bufsize:v:2 2100k \
-map a:0 -c:a:0 aac -b:a:0 192k \
-map a:0 -c:a:1 aac -b:a:1 128k \
-map a:0 -c:a:2 aac -b:a:2 96k \
-f hls \
-hls_time 6 \
-hls_list_size 0 \
-var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2" \
-master_pl_name master.m3u8 \
-hls_segment_filename "stream_%v/segment_%03d.ts" \
stream_%v/playlist.m3u8
# Generate encryption key
openssl rand 16 > enc.key
echo "http://example.com/enc.key" > enc.keyinfo
echo "enc.key" >> enc.keyinfo
openssl rand -hex 16 >> enc.keyinfo
# Encrypted HLS
ffmpeg -i input.mp4 \
-c:v libx264 -c:a aac \
-hls_time 6 \
-hls_key_info_file enc.keyinfo \
-hls_segment_filename "encrypted_%03d.ts" \
encrypted.m3u8
# LL-HLS with partial segments
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -tune zerolatency \
-c:a aac \
-hls_time 4 \
-hls_list_size 6 \
-hls_flags independent_segments+delete_segments \
-hls_segment_type fmp4 \
-hls_fmp4_init_filename init.mp4 \
-hls_segment_filename "ll_%03d.m4s" \
ll_playlist.m3u8
ffmpeg -i input.mp4 \
-c:v libx264 -c:a aac \
-f dash \
-seg_duration 4 \
-use_timeline 1 \
-use_template 1 \
output.mpd
ffmpeg -i input.mp4 \
-map 0:v -map 0:v -map 0:v -map 0:a \
-c:v libx264 -c:a aac \
-b:v:0 5M -s:v:0 1920x1080 \
-b:v:1 3M -s:v:1 1280x720 \
-b:v:2 1M -s:v:2 640x360 \
-b:a 128k \
-f dash \
-seg_duration 4 \
-adaptation_sets "id=0,streams=v id=1,streams=a" \
manifest.mpd
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset ultrafast -tune zerolatency \
-c:a aac \
-f dash \
-seg_duration 1 \
-frag_duration 0.1 \
-streaming 1 \
-ldash 1 \
-use_timeline 0 \
-use_template 1 \
-remove_at_exit 1 \
-window_size 5 \
ll_manifest.mpd
# FFmpeg as SRT server
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 3000k \
-c:a aac -b:a 128k \
-f mpegts "srt://0.0.0.0:9000?mode=listener"
# Send to SRT server
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset veryfast -b:v 3000k \
-c:a aac -b:a 128k \
-f mpegts "srt://server:9000?mode=caller"
# AES-128 encrypted SRT
ffmpeg -re -i input.mp4 \
-c:v libx264 -c:a aac \
-f mpegts "srt://server:9000?passphrase=mySecretKey123&pbkeylen=16"
# Receive and save
ffmpeg -i "srt://0.0.0.0:9000?mode=listener" \
-c copy output.mp4
# Receive and transcode
ffmpeg -i "srt://server:9000?mode=caller" \
-c:v libx264 -c:a aac \
output.mp4
FFmpeg 8.0 introduces the WHIP (WebRTC-HTTP Ingestion Protocol) muxer, enabling sub-second latency streaming to WebRTC endpoints. WHIP is becoming the standard for WebRTC ingestion, replacing proprietary solutions.
# Stream to WHIP endpoint
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset ultrafast -tune zerolatency \
-c:a libopus \
-f whip \
"https://whip-server.example.com/publish/stream_id"
# Low-latency webcam to WHIP (Linux)
ffmpeg -f v4l2 -i /dev/video0 \
-f pulse -i default \
-c:v libx264 -preset ultrafast -tune zerolatency -b:v 2500k \
-c:a libopus -b:a 64k \
-f whip \
"https://whip-server.example.com/publish/stream_id"
# Low-latency webcam to WHIP (macOS)
ffmpeg -f avfoundation -framerate 30 -i "0:0" \
-c:v libx264 -preset ultrafast -tune zerolatency -b:v 2500k \
-c:a libopus -b:a 64k \
-f whip \
"https://whip-server.example.com/publish/stream_id"
# Low-latency screen capture to WHIP (Windows)
ffmpeg -f gdigrab -framerate 30 -i desktop \
-c:v libx264 -preset ultrafast -tune zerolatency -b:v 3000k \
-c:a libopus -b:a 64k \
-f whip \
"https://whip-server.example.com/publish/stream_id"
# NVIDIA NVENC WHIP streaming
ffmpeg -hwaccel cuda -hwaccel_output_format cuda \
-i input.mp4 \
-c:v h264_nvenc -preset p3 -tune ll -zerolatency 1 -b:v 3000k \
-c:a libopus -b:a 64k \
-f whip \
"https://whip-server.example.com/publish/stream_id"
# Intel QSV WHIP streaming
ffmpeg -init_hw_device qsv=hw -filter_hw_device hw \
-i input.mp4 \
-c:v h264_qsv -preset fast -b:v 3000k \
-c:a libopus -b:a 64k \
-f whip \
"https://whip-server.example.com/publish/stream_id"
# With bearer token authentication
ffmpeg -re -i input.mp4 \
-c:v libx264 -preset ultrafast -tune zerolatency \
-c:a libopus \
-f whip \
-headers "Authorization: Bearer YOUR_TOKEN" \
"https://whip-server.example.com/publish/stream_id"
Multicast streaming setup, protocol re-streaming (RTMP/HLS/DASH/SRT inter-conversion), production patterns (encoder profiles, ABR ladders, monitoring), and a streaming troubleshooting catalogue live in references/production-and-troubleshooting.md. Load that reference when bridging protocols, building production ABR pipelines, or diagnosing streaming failures.
-movflags +faststart-report for debuggingThis guide covers FFmpeg streaming fundamentals. For hardware acceleration, see the hardware acceleration skill.
development
This skill should be used when the user asks to train, debug, scale, or improve ML models. PROACTIVELY activate for: (1) PyTorch, TensorFlow/Keras, JAX, Flax, Hugging Face Trainer/Accelerate training loops, (2) distributed training, DDP/FSDP/DeepSpeed, TPU/GPU setup, (3) mixed precision AMP/bf16, gradient accumulation, checkpointing, seeding, (4) overfitting, imbalance, loss functions, regularization, LR schedules, warmup, (5) memory optimization, gradient checkpointing, offloading, quantization-aware training. Provides: reproducible training best practices across deep learning and classical ML.
development
This skill should be used when the user asks to productionize, track, version, govern, monitor, or automate ML systems. PROACTIVELY activate for: (1) MLflow, Weights & Biases, Neptune, Comet, ClearML experiment tracking, (2) model registry, model versioning, artifact lineage, reproducibility, (3) Kubeflow, SageMaker Pipelines, Vertex AI Pipelines, Azure ML pipelines, Databricks workflows, (4) CI/CD, continuous training/evaluation, A/B tests, canary/shadow deployments, (5) drift detection, model monitoring, data validation, responsible AI governance. Provides: end-to-end MLOps architecture and operational safeguards.
development
This skill should be used when the user asks to optimize, export, serve, compress, or accelerate ML inference. PROACTIVELY activate for: (1) latency, throughput, p95/p99, batching, concurrency, KV cache, memory, or cost issues, (2) quantization INT8/INT4, GPTQ, AWQ, bitsandbytes, pruning, sparsity, distillation, (3) ONNX export, ONNX Runtime, TensorRT, TorchScript, torch.compile, XLA, OpenVINO, Core ML, TFLite, (4) Triton, TorchServe, TF Serving, BentoML, Seldon, KServe configuration, (5) edge deployment, CPU/GPU/TPU/Inferentia serving. Provides: hardware-aware inference optimization and safe benchmarking.
testing
This skill should be used when the user asks to tune hyperparameters, run sweeps, optimize search spaces, or use AutoML. PROACTIVELY activate for: (1) Optuna, Ray Tune, FLAML, AutoGluon, Hyperopt, Nevergrad, KerasTuner, W&B sweeps, (2) grid search, random search, Bayesian optimization, TPE, Gaussian processes, evolutionary search, (3) ASHA, Hyperband, successive halving, multi-fidelity optimization, population-based training, (4) learning-rate finder, batch-size search, early stopping, pruning, (5) reproducible sweep design and experiment analysis. Provides: budget-aware hyperparameter search strategy.