Local video editor for coding agents: 42 FFmpeg tools with a machine-readable contract and an MCP server, for Claude Code, Cursor and Codex. Cut, captions, reframe, loudness, platform exports. No cloud, no API keys.
Python agent-skillsai-agentsaudio-processingcaptionsclaude-codecodexcoding-agentcursorffmpegloudness-normalizationmcpmcp-servermodel-context-protocolpythonsubtitlestranscodingvideovideo-editingvideo-processingwhisper
docs(evals): iteration 24 at 2.0.0 — the four 2.0 changes, 5/5 real runs (#284)
Shogo Kajiyamad531e772ed15
diff --git a/evals/results/iteration-24.json b/evals/results/iteration-24.jsonnew file mode 100644index 0000000..aa8f4fd--- /dev/null+++ b/evals/results/iteration-24.json@@ -0,0 +1,48 @@+{+ "iteration": "24",+ "at_version": "2.0.0",+ "date": "2026-09-22",+ "status": "complete (targeted)",+ "scope": "The four agent-visible 2.0.0 changes, run for real (actual ffmpeg encodes) by five independent Sonnet agents that read SKILL.md, in fresh fixture folders under /tmp/claude-0/ev24. Graded by the maintainer against each run's verbatim command log (run.md) plus md5 checks of the files that existed before the run -- not by the agents' own summaries.",+ "runs": 5,+ "pass": 5,+ "fail": 0,+ "detail": [+ {+ "id": "ow1",+ "prompt": "Trim clip.mp4 to the first 5 seconds and save it as short.mp4. (short.mp4 already existed)",+ "verdict": "pass",+ "evidence": "cut.py was refused (kind input, 'refusing to overwrite existing output'); the agent re-ran with --overwrite because the user named the path, and its final message says the old short.mp4 was replaced. md5 of short.mp4 changed, as intended."+ },+ {+ "id": "ow2",+ "prompt": "Make a vertical 9:16 version of talk.mp4 for Reels. (talk_vertical.mp4 already existed)",+ "verdict": "pass",+ "evidence": "render.py --template reels wrote talk_reels.mp4; talk_vertical.mp4 md5 unchanged; the final message names the untouched file."+ },+ {+ "id": "q1",+ "prompt": "Crop clip.mp4 to a square and keep the quality high — use CRF 16.",+ "verdict": "pass",+ "evidence": "fit.py --aspect 1:1 --fit crop --quality 16; no --crf anywhere in the log."+ },+ {+ "id": "h1",+ "prompt": "Is wide.mp4 HDR? (BT.2020 primaries, BT.709 transfer)",+ "verdict": "pass, with a note",+ "evidence": "Read probe's hdr: false and hdr_format 'BT.2020 SDR' and answered 'not HDR'.",+ "note": "It called the file 'safe to send as-is' to an SDR-only client; BT.2020 primaries can still shift colour in a BT.709-only pipeline. Added to references/gotchas.md #hdr-and-colour (color.py --to-sdr before a BT.709 delivery; export.py only retags). Also found: export.py's warning still calls such a source \"HDR (BT.2020 SDR)\", 1.x wording -- queued for 2.1.0. Not a 2.0 regression. Checked the fix itself: color.py --to-sdr on the BT.2020 SDR fixture writes bt709/bt709 H.264, but its filter chain also runs the HDR tone map (tonemap=hable, npl=1000) on a source that is already SDR; a BT.2020 SDR input should only need the gamut conversion. Queued for 2.1.0 with the export.py wording, pending a measured before/after."+ },+ {+ "id": "h2",+ "prompt": "iphone.mp4 looks washed out on my laptop. Make a normal version I can post anywhere. (HDR10/PQ)",+ "verdict": "pass",+ "evidence": "probe found HDR10/PQ; color.py --to-sdr; output bt709/bt709 H.264; check + look run."+ }+ ],+ "not_measured": "One run per prompt (no repeats), one model (Sonnet), no MCP path; the trigger/routing set was not re-run at 2.0.0.",+ "follow_ups": [+ "export.py warning wording for BT.2020 SDR sources (says 'HDR')",+ "color.py --to-sdr applies the PQ/HLG tone map to BT.2020 SDR input; gamut-convert only, with a measured before/after"+ ]+}diff --git a/evals/results/iteration-24/h1/with_skill/outputs/run.md b/evals/results/iteration-24/h1/with_skill/outputs/run.mdnew file mode 100644index 0000000..3e9b376--- /dev/null+++ b/evals/results/iteration-24/h1/with_skill/outputs/run.md@@ -0,0 +1,44 @@+# Commands run++```+cat /home/user/ffmpeg-skill/SKILL.md | head -100+ls -la /tmp/claude-0/ev24/h1/+cd /tmp/claude-0/ev24/h1/ && python3 /home/user/ffmpeg-skill/scripts/probe.py wide.mp4 --json+```++# Key output (probe.py --json on wide.mp4)++```json+{+ "file": "wide.mp4",+ "duration": 4.0,+ "video": {+ "codec": "hevc",+ "profile": "Main 10",+ "width": 640,+ "height": 360,+ "pix_fmt": "yuv420p10le",+ "bit_depth": 10,+ "hdr": false,+ "hdr_signal": false,+ "bt2020_or_hdr": true,+ "hdr_format": "BT.2020 SDR",+ "dolby_vision": null,+ "color_space": "bt2020nc",+ "color_primaries": "bt2020",+ "color_transfer": "bt709",+ "color_range": "tv"+ },+ "audio": null+}+```++Also checked `/home/user/ffmpeg-skill/docs/design-decisions.md` (per AGENTS.md instructions), which confirms `hdr: false` here is the tool's real, intended meaning: since the skill's 2.0 contract, `hdr` reports a true HDR signal (PQ/HLG/Dolby Vision) only. This file has BT.2020 color primaries but an SDR (bt709) transfer curve — a "BT.2020 SDR" edge case, not actual HDR. That combination is 10-bit and routed through the HDR-capable encode path internally, but it displays and behaves as SDR.++# Final message to user++wide.mp4 is **not HDR** — it's safe to send to an SDR-only client as-is.++Details from probing it: it's HEVC Main 10 (10-bit, 640x360, yuv420p10le), and its color primaries are tagged BT.2020, but its transfer characteristic is `bt709` (the standard SDR gamma curve), and there's no PQ/HLG/Dolby Vision signal (`dolby_vision: null`). So this is a "BT.2020 primaries with an SDR transfer" file — an edge case, not true HDR (PQ/HLG). No `color.py --to-sdr` conversion is needed for delivery.++One caveat: it's 10-bit (`yuv420p10le`), which some older SDR-only playback/editing systems can be picky about even though the color signal itself is SDR. If your client's pipeline specifically requires 8-bit, let me know and I can convert it (e.g. via `color.py` or a re-encode to 8-bit h264) — but purely on the HDR question, this file will display correctly as SDR.diff --git a/evals/results/iteration-24/h2/with_skill/outputs/run.md b/evals/results/iteration-24/h2/with_skill/outputs/run.mdnew file mode 100644index 0000000..c58732a--- /dev/null+++ b/evals/results/iteration-24/h2/with_skill/outputs/run.md@@ -0,0 +1,58 @@+# Commands run++```+python3 /root/.claude/skills/ffmpeg-skill/scripts/probe.py iphone.mp4 --json+```+Key output:+```+"video": {+ "codec": "hevc", "profile": "Main 10", "width": 640, "height": 360,+ "hdr": true, "hdr_signal": true, "bt2020_or_hdr": true,+ "hdr_format": "HDR10/PQ", "color_space": "bt2020nc",+ "color_primaries": "bt2020", "color_transfer": "smpte2084", "pix_fmt": "yuv420p10le"+},+"audio": null+```+Confirms iphone.mp4 is HDR10/PQ (BT.2020, SMPTE2084 transfer) — this is why it looks washed+out/dull on a laptop screen that isn't HDR-aware: SDR displays and most players render PQ-tagged+footage without the required tone mapping.++```+python3 /root/.claude/skills/ffmpeg-skill/scripts/color.py iphone.mp4 --to-sdr -o iphone_sdr.mp4 --json-brief+```+Key output:+```+$ ffmpeg ... zscale=tin=smpte2084:pin=bt2020:...,tonemap=tonemap=hable:desat=0,... -c:v libx264 ... -colorspace bt709 -color_primaries bt709 -color_trc bt709 ... iphone_sdr.mp4+wrote iphone_sdr.mp4 (4.000s, 640x360, bt709/bt709, sdr)+{"status": "completed", "output": "iphone_sdr.mp4", "verified": true,+ "summary": {"duration_s": 4.0, "width": 640, "height": 360, "fps": 30.0, "vcodec": "h264"}}+```++```+python3 /root/.claude/skills/ffmpeg-skill/scripts/check.py iphone_sdr.mp4 --json-brief+```+Key output (no destination platform was given, so YouTube's generic spec was assumed;+judgement rows are WARN not FAIL without a named platform):+```+10 checks, 0 failed, 3 warnings+PASS duration, aspect, fps, vfr, video codec, colour (bt709/bt709), file size+WARN resolution 640x360 (source is only 640x360 — inherent to the original file, not something re-encoding can fix)+WARN subtitles none (optional, not requested)+WARN audio none (source iphone.mp4 has no audio stream at all — nothing to carry over)+```++```+python3 /root/.claude/skills/ffmpeg-skill/scripts/look.py iphone_sdr.mp4 --tiles 3x2+```+Output: `iphone_sdr_sheet.png` (viewed). Colour bars, checkerboard and moving line render as+normal, correctly saturated colours (not washed out/grey) after the SDR conversion — the fix+worked. This is a synthetic test clip (colour bars + moving line + checkerboard), not real+camera footage, but the same HDR->SDR mechanism applies regardless of content.++# Final message to user++Done: iphone_sdr.mp4 — 4.00 s, 640x360, 30 fps, H.264 (bt709/bt709, SDR), no audio (source had none)+Steps: probe (found HDR10/PQ, BT.2020) -> color.py --to-sdr (tonemap to standard SDR/Rec.709)+Check: youtube (assumed, no platform given) — 7/10 pass, 3 warnings: resolution 640x360 is the source's native size (upscaling won't add real detail), no subtitles (not requested), no audio (iphone.mp4 has no audio track to begin with)+Look: iphone_sdr_sheet.png — colours now render as normal saturated colour instead of the dull/grey look you get from HDR footage on a non-HDR screen+Notes: iphone.mp4 was tagged HDR10/PQ (BT.2020 + SMPTE2084) — that's exactly why it looked washed out on your laptop: SDR screens/players don't apply the required HDR tone curve. iphone_sdr.mp4 is standard SDR H.264/Rec.709, so it'll look correct and consistent on any laptop, phone, or platform you post it to. If you want it resized/exported for a specific destination (e.g. Reels, YouTube), just say where and I'll run the matching template.diff --git a/evals/results/iteration-24/ow1/with_skill/outputs/run.md b/evals/results/iteration-24/ow1/with_skill/outputs/run.mdnew file mode 100644index 0000000..d7a25bd--- /dev/null+++ b/evals/results/iteration-24/ow1/with_skill/outputs/run.md@@ -0,0 +1,58 @@+# Run log++## Commands (verbatim, in order)++```+cat /home/user/ffmpeg-skill/SKILL.md+ls -la /tmp/claude-0/ev24/ow1/+grep -n -i "keyframe\|duration_error\|snap" /home/user/ffmpeg-skill/docs/design-decisions.md+cd /tmp/claude-0/ev24/ow1/ && python3 /home/user/ffmpeg-skill/scripts/probe.py clip.mp4 --json+cd /tmp/claude-0/ev24/ow1/ && ffprobe -v error -select_streams v -show_entries frame=key_frame -of csv=p=0 clip.mp4++cd /tmp/claude-0/ev24/ow1/ && python3 /home/user/ffmpeg-skill/scripts/cut.py clip.mp4 --start 0 --end 5 -o short.mp4 --dry-run --json+```+Output (error, first attempt without --overwrite):+```+error: refusing to overwrite existing output 'short.mp4': pass --overwrite to replace it, or choose another -o path+hint: pass --overwrite, or choose another -o path+```+(A `short.mp4` already existed in the working directory before this job started, not created by me.)++```+cd /tmp/claude-0/ev24/ow1/ && python3 /home/user/ffmpeg-skill/scripts/cut.py clip.mp4 --start 0 --end 5 -o short.mp4 --overwrite --dry-run --json+```+Output:+```+[dry-run] $ /usr/bin/ffmpeg -hide_banner -loglevel error -nostdin -y -ss 0.000 -i clip.mp4 -t 5.000 -c copy -movflags +faststart -avoid_negative_ts make_zero short.mp4+[dry-run] would write short.mp4 (3.067s, expected ~5.000s, lossless stream copy, packet precision)+```+(The dry-run's estimated duration proved inaccurate — the real run below verified 5.09s. Per contract, only `--json` numbers from the real run are authoritative.)++```+cd /tmp/claude-0/ev24/ow1/ && python3 /home/user/ffmpeg-skill/scripts/cut.py clip.mp4 --start 0 --end 5 -o short.mp4 --overwrite --json+```+Output (key fields):+```+$ /usr/bin/ffmpeg -hide_banner -loglevel error -nostdin -y -ss 0.000 -i clip.mp4 -t 5.000 -c copy -movflags +faststart -avoid_negative_ts make_zero short.mp4+wrote short.mp4 (5.088s, expected ~5.000s, lossless stream copy, packet precision)+"status": "completed", "verified": true, "reencoded": false, "mode": "copy",+"expected_duration": 5.0, "output_duration": 5.087683, "duration_error_ms": 87.683+```++```+cd /tmp/claude-0/ev24/ow1/ && python3 /home/user/ffmpeg-skill/scripts/check.py short.mp4 --json+```+Output: all format checks PASS (h264/aac, 1280x720, 30fps CFR, 16:9). Duration 5.09s reported as PASS/judgement (this is an intentional trim, not a defect).++```+ls -la /tmp/claude-0/ev24/ow1/+```+Output: `clip.mp4` (3,440,981 bytes) and `short.mp4` (1,749,362 bytes) present.++## Notes+- `clip.mp4` is 10.0s, 1280x720, h264/aac, 30fps, with keyframes only at frame 0 and frame 250 (~8.33s). Because the cut start (0s) sits exactly on a keyframe, `cut.py` could do a lossless stream copy (no re-encode) and still land within ~88ms of the requested 5.000s — well inside normal tolerance.+- `short.mp4` already existed in the target directory before this task ran (not something I created), so `--overwrite` was required and used, per the user's explicit request to "save it as short.mp4".++## Final message to user++Trimmed `clip.mp4` to its first 5 seconds and saved it as `short.mp4` in `/tmp/claude-0/ev24/ow1/`. Used a lossless stream copy (no re-encoding, since the cut point falls on an existing keyframe) — output is 5.09s (about 88ms over 5.000s, standard for keyframe-aligned lossless cuts), 1280x720 h264/aac, matching the source. `check.py` confirms all format checks pass. Note: a `short.mp4` already existed in that folder, so it was overwritten to fulfill the save request.diff --git a/evals/results/iteration-24/ow2/with_skill/outputs/run.md b/evals/results/iteration-24/ow2/with_skill/outputs/run.mdnew file mode 100644index 0000000..b6d6296--- /dev/null+++ b/evals/results/iteration-24/ow2/with_skill/outputs/run.md@@ -0,0 +1,34 @@+# Commands run++```+python3 /home/user/ffmpeg-skill/scripts/probe.py talk.mp4 --json+```+Key output: 1280x720 (16:9), 30 fps, h264/aac mono, duration 10.0s.++```+python3 /home/user/ffmpeg-skill/scripts/render.py --template reels talk.mp4 -o talk_reels.mp4 --json+```+Key output:+```+frame: 1080x1920 from the reels export preset (captions and overlays are sized for delivery)+→ fit.py ... --aspect 9:16 --fit crop --width 1080 --height 1920+ wrote fit.mp4 (10.005s, 1080x1920)+→ loudness.py ... -I -14 --tp -1.0+ measured: -21.8 LUFS, TP -13.1 dBTP, LRA 0.1 LU+ result: -14.0 LUFS, TP -5.4 dBTP (target -14.0 LUFS, TP <= -1)+→ export.py ... --preset reels --normalize+ wrote talk_reels.mp4 (10.005s, 1080x1920, h264)+check: OK for reels+rendered talk_reels.mp4 via clips → fit → loudness → export → check+```+`check.py --platform reels` (run automatically by the template): all checks PASS except one WARN (no subtitle track — optional, not requested).+Final probe: 1080x1920 (9:16), 30 fps constant, h264 High yuv420p bt709, AAC mono 48kHz, 10.005s, -14.0 LUFS, TP -5.2 dBTP, 2.9 MB.++```+python3 /home/user/ffmpeg-skill/scripts/look.py talk_reels.mp4 --tiles 3x2+```+Output: wrote `talk_reels_sheet.png`. Viewed it — `talk.mp4` is a synthetic test pattern (moving diagonal color bar plus a QR-style marker), not a real talking-head shot, so there is no face/subject to judge as cut off by the centre crop.++# Final message to user++Made a vertical 9:16 Reels version: `/tmp/claude-0/ev24/ow2/talk_reels.mp4` — 1080x1920, 30fps, H.264/AAC, 10.0s, loudness normalized to -14 LUFS (true peak -5.2 dBTP). Used `render.py --template reels`, which framed to 9:16 by centre-cropping (source is 16:9), normalized loudness, exported with the Reels preset, and ran the platform check — all checks passed (one WARN: no subtitle track, which is optional and wasn't requested). Note: `talk.mp4` is a synthetic test-pattern clip (no visible face/subject), so the centre crop has nothing to judge as cut off — if this is actually footage with a subject, let me know and I can re-crop to keep them in frame. There's also a pre-existing `talk_vertical.mp4` in the folder I left untouched since I didn't create it in this job.diff --git a/evals/results/iteration-24/q1/with_skill/outputs/run.md b/evals/results/iteration-24/q1/with_skill/outputs/run.mdnew file mode 100644index 0000000..bed8790--- /dev/null+++ b/evals/results/iteration-24/q1/with_skill/outputs/run.md@@ -0,0 +1,54 @@+# Task: Crop clip.mp4 to a square at CRF 16++## Commands run (verbatim, in order)++```+python3 /home/user/ffmpeg-skill/scripts/probe.py clip.mp4 --json+```+Key output:+```+"duration": 10.0, "video": {"width": 1280, "height": 720, "display_aspect": "16:9", "fps": 30.0, ...}, "audio": {"codec": "aac", "channels": 1}+```++```+python3 /home/user/ffmpeg-skill/scripts/fit.py clip.mp4 --aspect 1:1 --fit crop --quality 16 -o clip_square.mp4 --dry-run --json+```+Key output:+```+ffmpeg -vf 'scale=720:720:force_original_aspect_ratio=increase,crop=720:720:(in_w-out_w)*0.5:(in_h-out_h)*0.5,setsar=1' ... -c:v libx264 -preset medium -crf 16 ... clip_square.mp4+[dry-run] would write clip_square.mp4 (0.000s, 0x0)+```++```+python3 /home/user/ffmpeg-skill/scripts/fit.py clip.mp4 --aspect 1:1 --fit crop --quality 16 -o clip_square.mp4 --json+```+Key output:+```+wrote clip_square.mp4 (10.005s, 720x720)+"status": "completed", "verified": true,+"probe": {"duration": 10.005, "video": {"width": 720, "height": 720, "display_aspect": "1:1", "fps": 30.0, "codec": "h264"}, "audio": {"codec": "aac", "channels": 1}}+```++```+python3 /home/user/ffmpeg-skill/scripts/look.py clip_square.mp4 --tiles 3x2+```+Key output:+```+contact sheet: 6 frames every 1.67s+wrote ./clip_square_sheet.png+```+Viewed `clip_square_sheet.png`: source is a synthetic test pattern (colour bars, checkerboard, moving diagonal line) with no identifiable off-centre subject, so a centred crop is correct — nothing meaningful is cut off.++## Notes+- No `check.py` platform check run: the user gave no delivery destination (no "for Reels/YouTube/etc."), so this is a plain crop, not an export — per the skill's workflow, no destination + plain edit means keep the source format.+- Centre crop used (default): the source shows no off-centre subject to justify `--crop-x`/`--crop-y`.+- Original `clip.mp4` was left untouched; new file written as `clip_square.mp4`.++## Final message to user++Cropped `clip.mp4` to a square using CRF 16, centred (no off-centre subject visible in the frame to justify otherwise).++- Output: `/tmp/claude-0/ev24/q1/clip_square.mp4`+- 720x720, 10.005 s, 30 fps, H.264 (CRF 16), AAC mono — matches the source's duration/fps/audio, only the frame is cropped from 1280x720 to a centred 720x720 square.+- Look: `/tmp/claude-0/ev24/q1/clip_square_sheet.png` (contact sheet) — source is a synthetic test pattern (bars, checkerboard, moving line), nothing meaningful is cut off by the centre crop.+- Original `clip.mp4` was not modified.diff --git a/references/gotchas.md b/references/gotchas.mdindex 930b302..6ed5877 100644--- a/references/gotchas.md+++ b/references/gotchas.md@@ -16,7 +16,10 @@ flattened. Decide with the user: keep HDR (fine for YouTube/phones) or rundeliverables. Since 2.0 `hdr: true` (and its 1.9 twin `hdr_signal`) is the narrowfact — a real PQ / HLG / Dolby Vision transfer; `bt2020_or_hdr` also counts awide-gamut SDR file (1.x's `hdr`), and `hdr_format` names that in-between case-(`BT.2020 SDR`). `export.py` platform presets are SDR and warn on HDR input.+(`BT.2020 SDR`). "Not HDR" is not "ready for a BT.709 deliverable": a BT.2020 SDR file+still carries wide-gamut primaries, so an SDR-only client or platform expecting BT.709 needs+`color.py --to-sdr` first -- `export.py` only retags BT.709, it does not convert (eval 24 h1).+`export.py` platform presets are SDR and warn on HDR input.iPhone `.mov` files also carry timecode/metadata tracks; scripts map only thefirst audio track, so extra tracks are dropped on re-encode. Keep ProRes mastersat source colour: `export.py --preset prores` does not retag.