ffmpeg

A set of FFmpeg commands and recipes for automating video and audio processing. FFmpeg is a command-line tool that converts, edits, filters, and encodes media files.

In plain words
What is it for?
Use it to convert, resize, trim, compress, mix, subtitle, or overlay media, and to create thumbnails, slideshows, and encoded outputs.
Why use it?
It helps avoid subtle command mistakes when options must be written in the correct order and when media settings affect the result.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/n0an/ffmpeg-skill/ffmpeg
Any agent
npx skills add n0an/ffmpeg-skill --skill ffmpeg
Clone the repo
git clone --depth 1 https://github.com/n0an/ffmpeg-skill

Made for: Claude Code, Codex.

Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,743 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00097 $0.01743
Opus 5 $0.00048 $0.00872
Sonnet 5 $0.00019 $0.00349
Haiku 4.5 $0.00010 $0.00174

Measured 2d ago against content hash 2246f00f4c8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ffmpeg scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ffmpeg/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

  1. Identify the task category (simple edit, audio processing, advanced filtering, asset generation, encoding tune-up).
  2. Open the matching reference file and pick the closest recipe.
  3. Adapt input paths, time ranges, dimensions, codecs, and filter parameters to the user's request.
  4. Before returning the command, walk through references/glossary.md to validate stream selectors, -map, -c copy use, and seeking position.
  5. 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 -y when 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 copy when 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 (-ss after -i) without -c:v copy. Input seeking (-ss before -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 yuv420p unless the user specifies otherwise. yuv420p is required for QuickTime and most consumer players.
  • For H.265 (HEVC) output destined for Apple devices, add -vtag hvc1 so 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 0 for constant quality.
  • When chaining filters, prefer -filter_complex once you need named streams ([v0], [a1]), multiple inputs, or both audio and video manipulation. Use -vf / -af for single-stream filtering.
  • After trim / atrim, always reset timestamps with setpts=PTS-STARTPTS / asetpts=PTS-STARTPTS, otherwise concat and downstream filters break.
  • Use -shortest when mixing inputs of different durations and the output should follow the shortest stream. Pair with duration=shortest inside amix when both behaviors are needed.
  • For pad, setsar=1:1 should 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 -vf and -filter_complex arguments 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 (.mp4 for H.264/H.265, .webm for VP9/Opus, .mkv when multiple subtitle tracks are needed, .mov for 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 -vtag for HEVC on Apple.
  • If the user already has a target file size, switch to two-pass ABR (-b:v <rate> with -pass 1 then -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.

Read the full file on GitHub · 88 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 88 lines · 97 tokens per session scan A 2246f00f4c8a

Subscribe to this mod's changes

ffmpeg is a skill published in the GitHub repository n0an/ffmpeg-skill (6 stars, last pushed 4mo ago), licensed MIT. It adds 97 tokens to every session and 1,743 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

media-ingest

Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.

garrytan/gbrain · 52 tokens

diagnostic-stem-delivery

Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow.

HKUDS/OpenSpace · 23 tokens

vox-director

Turn ONE topic into a finished Vox-style paper-collage explainer / ad video, end to end on the Atlas Cloud API + local ffmpeg — script, collage keyframes, motion, voice-over, music, captions, all automated. Use this whenever the user wants a "Vox style" video, a paper/torn-paper collage animation, a "motion collage"…

Alisa0808/vox-director · 236 tokens

seedance-vocab-ja

This skill should be used when the user asks for Japanese Seedance 2.0 prompt wording, Japanese cinematic vocabulary, or translation of camera, lighting, action, VFX, audio, and production terms into Japanese.

Emily2040/seedance-2.0 · 50 tokens

model-compatibility

Model family compatibility matrix covering loaders, resolutions, samplers, CFG, VAE, ControlNet, and LoRA compatibility for SD 1.5, SDXL, Flux, SD3, and video models.

artokun/comfyui-mcp · 47 tokens

comfyui-topology-viz

Turn a network topology into one stylized, AI-generated still image via a self-hosted ComfyUI instance — reuses the same topology model as threejs-network-viz (any of 8 topology-source integrations, or a freeform description). Use when the operator asks for a stylized, flashy, or AI-generated…

automateyournetwork/netclaw · 93 tokens