
ffmpeg
Provides FFmpeg commands and filter recipes for video automation pipelines - format conversion, resizing, trimming, audio mixing, subtitles and overlays, slideshows, thumbnails, and encoding tuning. Use when the user asks to convert, trim, compress, mix, overlay, or burn text into media, generate thumbnails or slideshows, build a Ken Burns or social-media clip, or tune ffmpeg encoding parameters such as CRF, preset, faststart, or hardware acceleration.
- Installs
- 273
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/n0an/ffmpeg-skill --skill ffmpeg- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ffmpeg automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Build correct FFmpeg commands for media-processing tasks by composing recipes from the references instead of recalling commands from memory. FFmpeg syntax is highly position-sensitive and easy to get subtly wrong, so prefer adapting a known-good command from these references over inventing one.
Workflow:
- Identify the task category (simple edit, audio processing, advanced filtering, asset generation, encoding tune-up).
- Open the matching reference file and pick the closest recipe.
- Adapt input paths, time ranges, dimensions, codecs, and filter parameters to the user's request.
- Before returning the command, walk through
references/glossary.mdto validate stream selectors,-map,-c copyuse, and seeking position. - If the user is running on macOS or Linux without a GPU, do not suggest
*_nvenc,*_qsv, or VAAPI encoders.
If doing partial work, load only the relevant reference files.
Core Instructions
- Always start commands with
-ywhen overwriting is acceptable; otherwise omit it so FFmpeg prompts before clobbering output. - Prefer
-c copy(stream copy / remux) when no filter, codec change, or precise trim is needed - it avoids re-encoding and is much faster. - Do not use
-c copywhen applying any video filter (scale,overlay,subtitles,trim,fade), mixing or modifying audio (amix,atempo,volume), burning subtitles, transcoding between codecs, or compressing. - For frame-accurate trimming, use output seeking (
-ssafter-i) without-c:v copy. Input seeking (-ssbefore-i) is fast but only seeks to the nearest keyframe and can produce black frames or off-by-seconds cuts. - For H.264 output, default to
-c:v libx264 -crf 18 -preset veryslow -movflags +faststart -pix_fmt yuv420punless the user specifies otherwise.yuv420pis required for QuickTime and most consumer players. - For H.265 (HEVC) output destined for Apple devices, add
-vtag hvc1so AirDrop and QuickTime accept the file. - Treat CRF as the primary quality knob: lower = higher quality, +6 roughly halves bitrate. Sane libx264 range is 17-28; 18 is "visually lossless"; libvpx-vp9 uses 15-35 with
-b:v 0for constant quality. - When chaining filters, prefer
-filter_complexonce you need named streams ([v0],[a1]), multiple inputs, or both audio and video manipulation. Use-vf/-affor single-stream filtering. - After
trim/atrim, always reset timestamps withsetpts=PTS-STARTPTS/asetpts=PTS-STARTPTS, otherwiseconcatand downstream filters break. - Use
-shortestwhen mixing inputs of different durations and the output should follow the shortest stream. Pair withduration=shortestinsideamixwhen both behaviors are needed. - For
pad,setsar=1:1should follow the resize/pad chain to lock pixel aspect ratio to 1:1 - omitting it can make the output appear stretched even when dimensions look correct. - Quote
-vfand-filter_complexarguments in single quotes (or escape commas inside expressions with\,) to avoid the shell or FFmpeg's expression parser swallowing characters. - When generating filenames programmatically, prefer extensions that match the codec (
.mp4for H.264/H.265,.webmfor VP9/Opus,.mkvwhen multiple subtitle tracks are needed,.movfor ProRes / Apple-flavored workflows). - If the user reports playback failures (black frames, audio drift, "file not supported"), check first for: missing
-pix_fmt yuv420p, missing+faststart, input seeking with-c copy, or wrong-vtagfor HEVC on Apple. - If the user already has a target file size, switch to two-pass ABR (
-b:v <rate>with-pass 1then-pass 2); CRF cannot enforce a size cap. - Verify metadata and stream layout with
ffprobe -show_streams -i <file>before debugging filter graphs - mismatched stream indices are the most common silent failure.
Output Format
When the user asks for a command, return:
- The full one-line FFmpeg command in a
shcode block, ready to paste. - A short bullet list explaining each non-trivial flag and filter.
- Any caveats: player compatibility, expected runtime cost, lossy steps, or known FFmpeg quirks linked from the relevant reference file.
Skip the explanation block only if the user explicitly asks for "command only".
When the user asks for a review of an existing command, organize findings as:
- Correctness - flags or filter ordering that will fail or produce wrong output.
- Quality - CRF, preset, color space, faststart, audio bitrate.
- Performance - unnecessary re-encodes, slow filter chains, missing hardware acceleration.
- Portability - codec/container mismatches, Apple HEVC tag, yuv420p for consumer playback.
Example output for a request like "compress this MP4 for the web, keep visual quality":
ffmpeg -i input.mp4 -c:v libx264 -crf 20 -preset veryslow -pix_fmt yuv420p -movflags +faststart -c:a aac -b:a 128k output.mp4
-crf 20keeps near-source quality while shrinking the file; drop to 18 for archival.-preset veryslowtrades encode time for ~20-30% smaller output at the same CRF.-pix_fmt yuv420pensures playback in Safari, QuickTime, and most browsers.+faststartmoves the moov atom to the front so the video starts playing before fully downloaded.-c:a aac -b:a 128kre-encodes audio at a transparent stereo bitrate.
End of example.
References
references/glossary.md- flag and filter syntax, stream selectors,-map,-c copyrules, input vs output seeking.references/simple-editing.md- format conversion (MP4/MKV/MOV/AVI), resize and pad, time-based trim.references/audio-processing.md- replace, extract, mix, crossfade, downsample, stereo-to-mono, format change.references/advanced-editing.md- playback speed, fps, jump cuts, social-media cropping, drawtext overlays, subtitles, watermarks, vstack, intro/outro assembly.references/asset-generation.md- image-to-video, slideshow with xfade, Ken Burns, GIFs, thumbnails, scene-change storyboards.references/encoding-and-tuning.md- daily-use template, libx264/libx265/libvpx-vp9, faststart, CRF guidance, seeking, GPU encoders, ffprobe.
Source
Recipes adapted from the Rendi FFmpeg cheatsheet. Sample URLs in the references point at storage.rendi.dev so commands can be run directly without local files.
FAQ
What does the ffmpeg skill do?
Provides FFmpeg commands and filter recipes for video automation pipelines - format conversion, resizing, trimming, audio mixing, subtitles and overlays, slideshows, thumbnails, and encoding tuning. Use when the user asks to convert, trim, compress, mix, overlay, or burn text into media, generate thumbnails or slideshows, build a Ken Burns or social-media clip, or tune ffmpeg encoding parameters such as CRF, preset, faststart, or hardware acceleration.
How do I install ffmpeg?
Run npx skills add https://github.com/n0an/ffmpeg-skill --skill ffmpeg in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ffmpeg/ (personal) or .claude/skills/ffmpeg/ (project).
Which AI agents can use ffmpeg?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ffmpeg safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ffmpeg?
It is published by n0an in n0an/ffmpeg-skill. It has 273 recorded installs.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image