ffmpeg-skill in 192 AI Runs: Fewer Passes, Constant Outputs, Honest Failures
Testing ffmpeg-skill with 3,229 weekly stars: running 4 models with and without the skill, 96 runs each
ffmpeg-skill (https://github.com/kajisho5/ffmpeg-skill) is an FFmpeg toolset for coding agents, created on 2026-09-03, MIT licensed. As of the release of v4.16.0 on 2026-11-27, the project has 11,548 total stars and 963 forks. GitHub trending shows "3,229 stars this week" for the weekly list. The author includes a high-scoring scorecard in the README section "Tested on real footage", but explicitly writes "The evaluation is Claude-only." And the scorecard has no baseline numbers for the "without skill" condition.
In a local offline sandbox we ran a controlled test of ffmpeg-skill v4.16.0: Claude Code 2.1.332 (Sonnet 5.5, Haiku 5.5) and Codex CLI 0.172.0 (GPT-6.2 Sol, GPT-5.6 Luna), covering 8 common single-step editing tasks, each repeated 3 times, with and without skill, 96 runs each, 192 total. Results: the with-skill group passed 88 out of 96, the without-skill group passed 95. The 8 with-skill failures all honestly reported failure when the local machine lacked the subtitle filter; "claimed done but failed" was 0 times (the without-skill group had 1).
These numbers show that ffmpeg-skill's value is not in helping agents do single-step edits they couldn't do before, because current models without the skill already got 95 of 96 right. Its core role is to harden encoding constraints, result re-testing, and failure boundaries into scripts: a 29.5-second frame-exact cut's output size converged from 100–763 MB without the skill to a constant 31.3 MB; audio-sync time dropped from 30–176 seconds to 18–41 seconds; when components were missing, most runs chose to stop explicitly and give fix commands (Sonnet average 23s, Haiku 22–44s, Luna 135–470s) rather than always working around. The cost of this determinism: on the 7 tasks where local components were complete, per-run cost rose 13%–62% with the skill.
42 Python scripts and SKILL.md routing
ffmpeg-skill is designed to counter the guessing behavior of coding agents writing raw commands. The README opens: "An agent that "knows FFmpeg" still guesses: it assumes a frame rate, picks a codec the container cannot hold, re-encodes a file that only needed a stream copy, and reports "done" without opening the result." (An agent that "knows FFmpeg" still guesses: it assumes a frame rate, picks a codec the container cannot hold, re-encodes a file that only needed a stream copy, and reports "done" without opening the result.)
To eliminate such guessing, the project provides 42 scripts that depend only on the Python standard library, requiring FFmpeg 6.1+ and Python 3.10+. Their organizing principle is "One tool per job, because each job promises something different, and the tool measures that promise after the run." For example, loudness.py re-measures overall loudness and true peak, cut.py reports how far the cut point is from a keyframe, silence.py returns kept segment intervals; when a metric can't be read, it's treated as failure: "A value a tool cannot read fails that step as not_measured; it does not pass."
On call safety and encoding strategy, all script parameters get type validation via argparse. "Nothing runs through a shell; no filter graph is accepted from the caller." There is also the principle "Lossless when possible." cut.py and loudness.py do stream copy for parts that need no change. cut.py --smart for H.264 frame-exact cuts only re-encodes the slice between the cut point and the next keyframe using source-file parameters, copying the middle GOP directly. Only when matching the source is impossible (HEVC, 10-bit, interlaced, variable frame rate, open GOP) does it re-encode the whole section, and it records the reason in smart.reason.
When an agent calls this toolset, it first reads about 80 mappings of "user intent → script command" in SKILL.md, e.g., "frame-exact but keep the quality" maps to cut.py in.mp4 --start 1:20.4 --end 2:05.1 --smart, "sync the lav mic" maps to sync.py camera.mp4 mic.wav --replace-audio. SKILL.md and project docs put explicit constraints on call behavior:
- No raw command calls: "never run raw
ffmpeg/ffprobe." And "One ordinary edit is one call." (One ordinary edit is one call: no probing ahead or dry-runs.) - Separation of execution and decision: "It executes an edit; it does not decide one." Subtitles are "burned as written; never rewrite or shorten them".
- Visual review and fixed reporting: After touching frames, the agent must call
look.pyto generate a contact sheet for self-check. Reports are fixed to five lines:Done/Steps/Check/Look/Notes. Failures start withFailed:. - Machine contract and presets:
contract --jsondefines each script's inputs, outputs, required components, and verification method; the MCP tool list is generated from it. "Over MCP,tools/listadvertises the core 12 (bold below). The other 30 are called by name throughtools/call". There are built-in platform presets fortiktok,reels,shorts,youtube,x,linkedin,facebook,podcast,broadcast; Douyin, WeChat Video, and Bilibili are not included.
For installation, npx ffmpeg-skill installs to ~/.claude/skills by default, --codex for Codex, --project into the current project's .claude/skills. npx ffmpeg-skill setup scans all local agents and installs everywhere, only installing FFmpeg if ffmpeg isn't already runnable (runs brew install ffmpeg-full on macOS). Releases come fast: the most recent 100 releases went from v3.4.3 on 11-11 to v4.16.0 on 11-27 (13 on 11-21, 12 on 11-26). Among the last 100 commits from 11-22 to 11-27, 38 are signed "Claude", 32 maintainer, 22 GitHub Actions bot. So the README warns: "Pin a tagged version, not main."
Inside scripts: input measurement and result verification
Each call to a specific
ffmpeg-skill script runs four fixed steps: first measure the input file's duration, frame rate, codec, color, and channels and plan parameters from measured values; then check whether the local FFmpeg has the required components; then run the FFmpeg processing; finally re-measure the metric that script promises and output JSON.
Component checks are backed by the doctor mechanism, which parses ffmpeg -encoders / -decoders / -filters / -bsfs to see which modules the local build includes (e.g. libx264, libass, zscale, loudnorm, xfade), applying "Unknown is not missing." The README distinguishes global state from per-script availability: "a plain Homebrew ffmpeg without subtitles" sets doctor's top-level ok to false, but most scripts still work; check the tools field of doctor --json. When a script's required component is missing, the script refuses to run, returns filter_missing and an install command.
On result delivery, scripts strictly separate measured metrics from unmeasured properties: "every writing tool lists the properties it did not measure in unverified" (e.g. picture_content, subject_framing, legibility). In our test, loudness.py's JSON shows it ran three FFmpeg commands internally (measure input loudness, apply linear gain based on measured value, re-measure output loudness), with the video stream's encoder copy (no re-encode). The verification field records expected as -14, measured as -14.01, tolerance as 1.0, and lists perceived_loudness in unverified (subjective perception can't be measured).
Design of the offline controlled experiment with 8 editing tasks
The author's README discloses test scores: verification steps on 10 real-footage files passed 92/92, sync.py 40/40 with offset error ≤10 ms, scenes.py F1 of 0.97, and an agent evaluation run by Sonnet and judged by Opus (initial 24 questions × 3 runs 72/72, later expanded to 110 questions). Because there was no non-Claude environment and no "without skill" baseline, we designed a local controlled experiment on 2026-11-27.
The experiment ran in an offline local headless sandbox against ffmpeg-skill v4.16.0. The with-skill group followed the official --project method into each run's working directory (Claude Code in .claude/skills/ffmpeg-skill, Codex in .agents/skills/ffmpeg-skill); the without-skill group had no such directory. The prompt was identical in both groups, never mentioning the skill, so agents had to discover it themselves. All personal instruction files, MCP servers, plugins, hooks, and personal skills were disabled. Clients: Claude Code 2.1.332 (Sonnet 5.5, Haiku 5.5) and Codex CLI 0.172.0 (GPT-6.2 Sol, GPT-5.6 Luna).
Local environment: Homebrew FFmpeg 8.1.1 without libass, freetype, or vidstab, so subtitles, drawtext filters and the stabilization module are missing. doctor marks the caption, graphics, stabilize scripts unavailable and suggests brew install ffmpeg-full. Since that command pulls 84 dependencies, we kept the default state to observe real behavior when components are missing. The primary test footage is from a self-made 1080p lecture video (90 seconds, 62.9 MB, keyframe every 10 seconds), overlaid with a per-frame moving square (to verify cut frames) and dynamic grain (to approximate real-capture size). We also prepared two heterogeneous short clips, a video with poor camera audio plus a clean recording that starts 1.734 seconds early, narration with known pauses, and an SRT with 5 Chinese subtitles. The 8 tasks:
- Cut: take 0:12.5 to 0:42.0, "frame-exact endpoints, as much quality as possible", scoring script compares start and end frames frame-by-frame.
- Vertical: convert to 1080x1920 without cropping, scoring uses multi-scale matching to verify picture integrity.
- Loudness: adjust to -14 LUFS, true peak -1 dBTP, no re-encode of video. Scoring re-measures with
ebur128and checks stream info. - Remove pauses: compress pauses longer than 0.5 s to about 0.2 s. Scoring checks that voice is undamaged, no residual pause over 0.6 s, and at least 6.5 seconds cut.
- Join: two clips of different specs with 0.5 s crossfade, output 1920x1080 30fps. Scoring verifies output specs and fade range.
- Audio-video sync: align the clean recording to the camera video. Scoring uses cross-correlation for offset, tolerance 20 ms.
- Subtitles: hard-burn the SRT into the frame. Scoring compares visual changes at the 5 subtitle timings.
- Compression: keep 1080p, compress to under 25 MB for email. Scoring checks size, resolution, duration.
All scoring scripts were first self-tested with a correct version and an incorrect version to confirm the correct one always passes and the wrong one always fails. Mid-experiment we fixed an overly strict pause threshold and a vertical single-scale misjudgment (one Codex run scaled to 1056x594 and added padding), and re-ran the 5 infrastructure failures where small-model rounds dropped after 12 minutes offline without answering (all 5 passed). Each run required agents to report a fixed JSON status (done or failed), classified as "passed and reported done", "reported done but failed", or "honestly reported failed". Cost: Claude Code uses CLI's total_cost_usd; Codex is calculated at OpenAI Standard API prices (per million token: GPT-6.2 Sol input $2.00, cache hit $0.10, output $10.00; GPT-5.6 Luna input $0.20, cache hit $0.02, output $1.20; subscription users actually deduct credits).
Overall table of 192 runs with and without skill
8 tasks × 4 models × 3 runs each with and without skill, all 192 runs summarized below:
| Group | Passed (max 24) | Claimed done but failed | Honestly reported failed | Avg cost/run | Avg tokens | Avg time |
|---|---|---|---|---|---|---|
| Claude Code · Sonnet 5.5 · with skill | 21 | 0 | 3 | $0.105 | 168K | 77s |
| Claude Code · Sonnet 5.5 · without | 24 | 0 | 0 | $0.078 | 136K | 89s |
| Codex · GPT-6.2 Sol · with skill | 24 | 0 | 0 | $0.155 | 570K | 153s |
| Codex · GPT-6.2 Sol · without | 24 | 0 | 0 | $0.098 | 250K | 119s |
| Claude Code · Haiku 5.5 · with skill | 22 | 0 | 2 | $0.0083 | 223K | 139s |
| Claude Code · Haiku 5.5 · without | 24 | 0 | 0 | $0.0083 | 248K | 163s |
| Codex · GPT-5.6 Luna · with skill | 21 | 0 | 3 | $0.0104 | 182K | 141s |
| Codex · GPT-5.6 Luna · without | 23 | 1 | 0 | $0.0101 | 180K | 201s |
Overall pass rates: with skill 88/96, without 95/96. Excluding the subtitle task where the local machine lacks filters, the other 7 tasks together had 167 out of 168 runs pass (only Luna without skill missed once in audio-sync; Haiku with skill had one acceptable output but self-reported failed). Note that each group is only 3 samples, and Claude Code and Codex use different models and billing, so the table only shows changes within a group before/after the skill; it cannot rank the two tools.
Output size differences in frame-exact cut
The cut task showed the biggest output size differences. All 24 runs achieved 0 frame deviation at start and end, but output file sizes ranged 3 to 24 times larger (the 29.5 seconds of source at average bitrate is about 20.6 MB).
- With-skill group (12 runs): all 12 outputs from 4 models are exactly 31.3 MB, all calling
cut.py --smart, copying the middle 600 frames viastream copyand re-encoding only 285 frames around the cut points. - Claude Code without skill (6 runs): Sonnet 5.5 and Haiku 5.5 outputs between 100–135 MB, re-encoding the whole video with
CRF12 or 14. - Codex without skill (6 runs): GPT-6.2 Sol and GPT-5.6 Luna outputs up to 607–763 MB, doing full lossless re-encode with
CRF0 orQP0.
The direct cause is the prompt's "keep quality as much as possible". Agents without the skill, to preserve quality, typically chose extremely low CRF and re-encoded the whole clip, exploding size. ffmpeg-skill bakes the engineering practice of "copy the middle GOP, re-encode only cut points" into cut.py --smart, removing parameter arbitrariness across models.
Error and workaround behavior when the subtitle filter is missing
With the
subtitles filter missing locally, with and without skill show two very different engineering strategies. In the with-skill group's 12 runs, caption.py detects the missing component, returns filter_missing and suggests brew install ffmpeg-full. Ultimately 8 runs stopped and honestly reported failure, 4 worked around it and produced content:
- Sonnet 5.5 with skill (3 failures): average 23 seconds, reports all state the missing
subtitles/drawtextfilters requiringffmpeg-full; one also noted the machine is offline so install is impossible. (Note: before formal statistics, a trial run had a 15-minute limit; the formal experiment used 25 minutes. Sonnet calledoverlay.py5 times, each re-encoding the whole clip, exceeded the 15-minute limit and didn't return a report, but the produced file actually passed scoring.) - GPT-5.6 Luna with skill (3 failures): 135, 270, 470 seconds respectively, all honestly report missing
subtitlesfilter and noffmpeg-fulllocally. - Haiku 5.5 with skill (2 failures, 1 success): 2 failed within 22–44 seconds; 1 used Pillow to draw each subtitle as transparent PNG, called the skill's
overlay.pyto overlay each, and checked frames withlook.py, taking 561 seconds. - GPT-6.2 Sol with skill (3 workarounds): searched the machine for other FFmpeg versions, generated subtitle layers with Pillow and composed with
overlay.py, usedlook.pyto spot that the subtitles overlapped existing text at the bottom, moved them up and re-did, finally re-checked withcheck.py. Average 537 seconds, $0.451, 2.6 million tokens.
In contrast, all 12 runs without the skill worked around by "Pillow draws transparent PNG + FFmpeg overlay timed overlay". Sonnet averaged 284 s ($0.163), Haiku 424 s, Sol 327 s ($0.222), Luna 635 s. The 8 with-skill failures never lied about completion; they gave accurate reasons and fix commands. Pipelines that need to clearly expose environment deficiencies benefit from this deterministic refusal, while ad-hoc emergency delivery benefits more from an agent's autonomous workaround.
Per-run cost, time, and compression unit conversion
Averaged over all 8 tasks, with skill Sonnet costs 35% more per run, Sol 59% more, Haiku same, Luna 3% more, largely because the with-skill group stopped early on subtitle tasks, lowering the average. Excluding subtitle tasks and looking only at the 7 fully-equipped tasks, per-run cost rises with skill: Sonnet +62%, Sol +41%, Haiku +13%, Luna +25%. Codex + Sol with skill reads SKILL.md once, references docs twice, and script --help 0.9 times on average, consuming 2.3x more tokens than without. Across tiers, Haiku and Luna cost about a tenth per run compared to Sonnet and Sol, but pass counts are similar.
By task, all 24 loudness runs hit -14.0 LUFS, true peak -3.4 or -3.5 dBTP, without re-encoding video; with and without skill behaved the same. On audio-sync and 25 MB compression, time diverged in opposite directions:
- Audio-sync (with skill wins broadly):
sync.pyhas a built-in cross-correlation algorithm, saving the agent from writing an alignment script on the spot. Time: Sonnet 18s vs 30s (tokens 90k vs 188k), Sol 41s vs 77s, Haiku 24s vs 47s, Luna 40s vs 176s. 22 of 24 runs had error under 1 ms. - Compression to 25 MB (with skill slower): Time: Sonnet 233s vs 113s, Sol 225s vs 179s, Haiku 414s vs 334s, Luna 275s vs 197s. One reason is unit conversion:
export.py's--max-mbuses binary MiB (help text: "fit it under MB megabytes (MiB)"). Passing--max-mb 25corresponds to about 26.2 million bytes. The 9 runs that calledexport.pyinitially all passed--max-mb 25; 8 of them then changed the parameter to 23–24 and re-compressed (Sol once passed exactly23.84185791015625, the MiB equivalent of 25,000,000 bytes). The remaining 1 run (Luna + skill) didn't recompress: output was 25,570,396 bytes (24.39 MiB, reported as "about 24.38 MB, under 25 MB attachment limit"). Our scoring judged by MiB and passed it, but in decimal it's 25.57 MB, so an email service that caps in decimal would reject it. The other 23 outputs ranged from 19.1 to 24.6 MB in decimal.
Model discipline in calling scripts and edge cases
Installing the skill doesn't mean all models follow the rules. In the 24 with-skill runs, actual calls to skill scripts: Sol 24 times, Luna 24 times, Sonnet 21 (bypassed skill twice on 25 MB compression and once on vertical, writing raw ffmpeg), Haiku 20 (skipped once each on loudness, pause removal, join, 25 MB compression).
Regarding the SKILL.md ban on "never run raw ffmpeg/ffprobe", across 24 runs the 4 models violated it by directly calling native ffmpeg or ffprobe: Luna 2, Sonnet 7, Sol 15, Haiku 19. Sonnet and Sol mostly called ffprobe after scripts to double-check. GPT-5.6 Luna was most disciplined: all 24 runs went through scripts with only 2 extra native calls.
The experiment also caught two boundary cases. First, the only "claimed done but failed": Codex + Luna without skill on audio-sync had a 25 ms deviation, over the 20 ms tolerance. Its own cross-correlation computed an offset of 1.73 s (4 ms from the true 1.734 s), but adding -avoid_negative_ts make_zero introduced about 21 ms offset (we reproduced the same command: 25.3 ms deviation; without that flag, 4.0 ms; cutting at exactly 1.734 s gives 0.0 ms). Second, "did it right but reported failure": Haiku with skill on pause removal produced a fully correct output, but thought the head and tail should keep 0.2 s while silence.py keeps 0.1 s by default, so it judged itself non-compliant and reported failed.
Equals-sign permission block in Claude Code sandbox
During automated integration testing, we hit a specific permission mechanism in Claude Code's sandbox. The experiment enabled the sandbox with autoAllowBashIfSandboxed: true (auto-allow commands inside sandbox), but in practice: any command argument containing an equals sign in KEY=VALUE form is not auto-allowed; it triggers the usual permission approval.
FFmpeg and ffprobe arguments almost always contain equals signs, e.g., ffprobe -show_entries stream=..., -af loudnorm=I=-14, -of csv=p=0. In unattended headless mode these get rejected for lack of human approval. Only a bare ffprobe media/talk.mp4 (no equals) passes. The official sandboxing docs, Auto-allow mode section, state: "This happens with commands such as FOO=bar npm test … and with make CC=clang".
As a result, in the first round, Claude Code without-skill had 3 runs fail within 9–33 seconds because commands were rejected. Agents with skill call python3 scripts/<name>.py arguments, which is less affected. The fix is to explicitly add Bash to the --allowedTools startup flag (commands still stay inside the offline sandbox that only allows writing to the working directory and temp directories). After the fix, we invalidated and re-ran both Claude Code groups (with and without skill).
Environment preparation before installation and experiment limitations
Based on the 192 runs, when to install ffmpeg-skill and what to prepare beforehand can be summarized into clear operating guidelines:
- Appropriate scenarios: batch automation pipelines, H.264 frame-exact cuts with size control (
cut.py --smart), multi-camera audio-video sync (sync.py), or situations where metrics must be re-measured and silent re-encode degradation is never acceptable. For one-off interactive emergencies with missing local filters, not installing the skill and letting the agent work around is more likely to produce a result. - Pre-install checklist: pin a specific tag version (as README says: "Pin a tagged version, not
main."); rundoctor --jsonand check thetoolsfield, or installffmpeg-fullto add subtitle/text filters; noteexport.py --max-mbuses MiB for byte limits; in Claude Codeheadlesssandbox, addBashto--allowedTools.
This test has 6 limitations to consider when interpreting:
- Limited sample size and task complexity: only 3 runs per group, enough to show phenomena exist; 8 tasks are common single-step edits, not multi-step engineering scripts (e.g.,
render.py,batch.py). - Missing local components: local FFmpeg
8.1.1lacksffmpeg-full, so subtitle, text, and stabilization filters are missing. The subtitle task tested behavior when components are missing, not the rendering quality ofcaption.pyitself. - Only objective metrics evaluated: scoring only checks frame cut points, duration, loudness, sync error, size, etc. No subjective quality like subtitle aesthetics or naturalness of pause cuts.
- Shared temp directory: Claude Code sandbox maps temp directories to the user-level temp directory, so concurrent runs shared the path. Although all runs involving temp files passed scoring and no interference was observed, potential effects can't be fully excluded.
- Compression size unit: scoring for the 25 MB task used MiB. If decimal bytes were the limit, Luna + skill would have one run over.
- Version timeliness: only tested
v4.16.0(released 2026-11-27). The project can release over a dozen versions a day, so conclusions may not hold for later versions.
References
- ffmpeg-skill repository: https://github.com/kajisho5/ffmpeg-skill
- ffmpeg-skill v4.16.0: https://github.com/kajisho5/ffmpeg-skill/releases/tag/v4.16.0
- Claude Code sandbox docs (Auto-allow mode): https://code.claude.com/docs/en/sandboxing
- Claude Code headless mode: https://code.claude.com/docs/en/headless
- Codex non-interactive mode (codex exec): https://developers.openai.com/codex/noninteractive
- OpenAI pricing: https://developers.openai.com/api/docs/pricing