An agent with a video editor, and a rule that it has to measure its own work

Generating a video is now the easy half. The hard half is the file: the right duration, the right aspect ratio, captions inside the safe area, audio that does not clip, a size that fits under a platform limit. Anyone who has handed an editing task to an LLM knows what comes back instead. A confident paragraph about what it did, and a file that turns out to be 59.4 seconds when the spec said 60.
ffmpeg-skill, which added 3,065 stars in the past week and sits at 12,445, is an attempt to fix the second half. It is an Agent Skill: a folder of instructions plus 41 Python scripts that drive local ffmpeg and ffprobe. Install is one line, npx ffmpeg-skill, and there is no API key, no account, and no cloud step.
The workflow is the product
The README states the loop plainly: probe, edit losslessly where possible, check, verify. Every tool in the set follows it.
Probe means reading the input before touching it, so the agent knows the source duration, frame rate, codec, colour tags and audio layout rather than guessing from a filename.
Lossless where possible is the rule that saves quality and time. cut.py and loudness.py stream-copy the parts they do not need to change. Re-encoding happens only when it must: frame-accurate cuts, filters, format changes, or a keyframe farther away than the tolerance. join.py re-encodes because it has to crossfade and conform mismatched clips, but it will also stream-copy when the clips already match.
Check and verify are where this differs from a folder of shell snippets. check.py measures the output against platform rules. verify.py runs the toolchain on real device files and reports pass or fail per step. The demo card on the repo's front page is the shape of a finished job: final.mp4, 59.98 s, 1080×1920, 30 fps, −14.0 LUFS, verified.
That last number is the one worth staring at. −14 LUFS is not a preference; it is the loudness target most platforms normalise toward. Getting there is not a single flag. loudness.py runs two-pass EBU R128 loudnorm, then measures the file it just wrote, and re-encodes until the true peak is under the limit, because lossy encoders overshoot. A single-pass version would report success and ship a file that clips.
41 tools, 12 of them visible
The tool count is a marketing number until you look at how the MCP surface handles it. Every tool is callable as an MCP tool, but tools/list advertises only a core twelve by default: render, look, caption, export, check, fit, cut, audio, loudness, graphics, silence, probe. Set FFMPEG_SKILL_MCP_FULL=1 and all 41 appear.
That decision is about context budget. An agent that loads 41 tool schemas at the start of a session spends tokens on capabilities it will not use, and a long schema list also makes tool selection worse. The full set stays reachable through tools/call by name, so hiding them costs nothing in capability.
The tools themselves cover the unglamorous list: cut, join, silence removal, fit to duration and aspect, captions including karaoke-style highlights, overlays and motion graphics, HDR to SDR and LUTs, audio cleanup and typed dynamics, sync with drift correction, multicam, loudness, delivery checks, whole-edit project rendering, batch folders.
There is also contract --json, which describes all 41 tools as a machine-readable document: input schema generated from the argument parser, output schema, role, required FFmpeg capabilities, whether dry-run is supported, which verification tools should run afterwards, whether a visual check is required. The contract is generated from the code that runs, not maintained next to it, which is the difference between documentation and a promise.

Dry runs, plans, and refusing to render
The most useful safety feature is duller than a sandbox: --dry-run, which prints the FFmpeg command lines and writes nothing.
Every tool takes it, plus --plan FILE, which saves the dry run as a plan with fingerprinted inputs. Later, render.py FILE executes that plan and refuses if any input changed. That is a small piece of engineering with a large effect on agent reliability: the agent can show you what it intends to do, you can approve it, and the thing that runs is the thing you approved.
The tests around this are unusually literal. One test runs every tool whose contract says its dry run executes no ffmpeg, behind a fake ffmpeg binary, and asserts that no ffmpeg call happened and no file appeared. Another runs every tool that supports dry-run behind an ffmpeg that logs each decode, and asserts that no output file appeared and that any tool which did decode is one the contract lists as analysis-only.
There is a similar stubbornness about size limits. export.py --max-mb 25 does a two-pass encode to fit the file under the cap, then measures it. Platform presets exist for YouTube, 4K YouTube, Reels, TikTok, Shorts, LinkedIn, Facebook, X, HDR YouTube, AV1, ProRes, DNxHR, alpha masters, and a copy preset that remuxes a damaged file and counts the errors before and after.
Why this had to be a skill and not an app
A desktop editor already does all of this. What it does not do is let an agent operate it while explaining each step in a language the agent can act on.
The skill format gives the agent a fixed procedure and a set of narrow tools, which is a better fit than a GUI for one reason: verification is cheap. An app expects a human to look at the result. A skill can require the agent to read the measurements back and decide whether the job is finished.
The repo's own framing is that it teaches a workflow rather than a list of commands, and the code backs that up. The contract tells the agent which verification tool to run after which edit. The --json output returns a structured result including a probe of the output, so the agent does not have to parse log lines. --json-brief trims that to roughly a third of the bytes for callers that only act on status, path, verified flag and a compact summary.
Small things point the same way. Time flags accept seconds, mm:ss, hh:mm:ss.fff or SMPTE with an optional frame-rate suffix. A hung ffmpeg is killed and reported rather than waited on forever. --overwrite is required before an existing output is replaced. Ctrl-C stops the running ffmpeg, removes the partial file and reports kind: interrupted.
What it does not solve
The skill does not decide whether a cut is any good. It can tell you the file is 30.0 seconds at −14 LUFS with captions inside the safe area; it cannot tell you the joke lands. That still needs a person, or at least a different model with taste.
It also does not generate anything. There is no diffusion model, no text-to-video, no upscaler beyond what FFmpeg's filters provide. This is the finishing layer, and the README is honest that the whole thing is a local FFmpeg engine.
Which is the right scope for the moment. The models that make frames are improving monthly and competing on price. The layer that turns frames into a deliverable has been neglected, because it is boring, and because it is where a lot of money leaks: re-uploads, rejected files, captions under the platform UI, audio that gets normalised into mush.
Twelve stable tools out of 41 is a modest ratio, and the CI matrix of FFmpeg 6.1, 7.1, 8 and 9 tells you the author expects that surface to break. But the direction is clear. If agents are going to touch video, they need a way to check their own output, and a number on a card that says −14.0 LUFS is a better ending than a paragraph explaining that the audio should be fine.
Turn ideas into images with ChatPicture
60 free credits every day. Generate, edit, and download — no prompt engineering degree required.
Related articles
Thirteen eggs stump a whole lineup of models: AI images can draw, but they cannot count
On the evening of November 18, "Doubao stumped by thirteen eggs" reached Weibo's trending list. Of nine image models, only four got the number right, and research already says prompt tweaks cannot fix counting. The problem is a diffusion model with no counter.
A trading skill pack that refuses to tell you what to buy
claude-trading-skills ships four workflows for reviewing a portfolio, screening a setup and journaling a closed trade. It never issues a buy signal, and the README says so three times.
Tencent's Hy3D 3.6 generates the 3D draft, not the finished asset
Hy3D 3.6 pushes generated models to two million faces and eight-kay PBR textures, then hands them to a retopology artist. Tencent had hundreds of its own 3D artists blind-test it first.
ChatPicture
Start generating
Generate production-ready AI images for e-commerce, design, and film.