跪拜 Guibai
← Back to the summary

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:

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

image 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:

  1. 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.
  2. Vertical: convert to 1080x1920 without cropping, scoring uses multi-scale matching to verify picture integrity.
  3. Loudness: adjust to -14 LUFS, true peak -1 dBTP, no re-encode of video. Scoring re-measures with ebur128 and checks stream info.
  4. 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.
  5. Join: two clips of different specs with 0.5 s crossfade, output 1920x1080 30fps. Scoring verifies output specs and fade range.
  6. Audio-video sync: align the clean recording to the camera video. Scoring uses cross-correlation for offset, tolerance 20 ms.
  7. Subtitles: hard-burn the SRT into the frame. Scoring compares visual changes at the 5 subtitle timings.
  8. 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

image 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

image 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).

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

image 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:

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:


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:

This test has 6 limitations to consider when interpreting:

  1. 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).
  2. Missing local components: local FFmpeg 8.1.1 lacks ffmpeg-full, so subtitle, text, and stabilization filters are missing. The subtitle task tested behavior when components are missing, not the rendering quality of caption.py itself.
  3. 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.
  4. 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.
  5. Compression size unit: scoring for the 25 MB task used MiB. If decimal bytes were the limit, Luna + skill would have one run over.
  6. 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