Skip to content
riffkitPublic

About

Video breakdown for coding agents (Claude Code, Codex): your agent analyzes a short video shot by shot on your own machine, with cut, caption, loudness and word times measured. You get a riffsheet: what happens, why it holds a viewer, what your own version has to keep.

Topics

Resources

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Repository files navigation

The riffsheet icon

riffsheet

Video breakdown for coding agents: your agent analyzes a short video shot by shot, on your own machine.
Cut times, caption on and off times, loudness and word times are measured; the agent reads laid-out pictures for the rest.
You get a riffsheet: what happens, why it holds a viewer, and what your own version has to keep.

Install · Examples · How accurate it is · Limits · 简体中文

Free, MIT, runs offline with Python and ffmpeg. An agent skill for Claude Code, Codex and other agents that can run commands and read images.
Made by Riffkit. riffsheet needs no account and sends nothing to us.

A short video of ours playing beside its riffsheet, which fills in as it plays: the measured shot changes, flashes, captions and sound, and the agent's reading of each shot.

A video of ours, broken down by riffsheet. Full result in examples/red-carpet.

Install

You need ffmpeg 7 or newer and Python 3.9 or newer. Spoken words need a speech recognizer: the tool's own is the optional faster-whisper package and its speech model. When your agent judges that a video's speech matters and the recognizer is not set up, it tells you what it would add and what it costs (download, disk space, time, network), and sets it up only if you say yes (see Requirements).

The skill is the folder skills/riffsheet (SKILL.md, scripts/, references/, schema/); each way below puts that folder alone in your agent's skills folder, without the examples, their pictures and the tests.

1. Tell your agent (Claude Code, Codex, or any agent that runs commands):

Install the riffsheet skill from https://github.com/riffkit/riffsheet, then break down ~/Downloads/clip.mp4

2. Or with the skills command line tool (needs Node): npx skills add riffkit/riffsheet

3. Or in Claude Code, as a plugin: claude plugin marketplace add riffkit/riffsheet, then claude plugin install riffsheet@riffsheet.

4. Or with git: keep the repository anywhere and link its skill folder into your agent's skills folder:

git clone https://github.com/riffkit/riffsheet ~/src/riffsheet
mkdir -p ~/.claude/skills && ln -s ~/src/riffsheet/skills/riffsheet ~/.claude/skills/riffsheet   # Claude Code
mkdir -p ~/.agents/skills && ln -s ~/src/riffsheet/skills/riffsheet ~/.agents/skills/riffsheet   # Codex

git -C ~/src/riffsheet pull updates it. Other agents: keep the repository anywhere and say "Read skills/riffsheet/SKILL.md in the riffsheet folder and follow it."

If you put the whole repository in ~/.claude/skills/riffsheet with git before, move it out and link the skill folder in its place:

mkdir -p ~/src && mv ~/.claude/skills/riffsheet ~/src/riffsheet && git -C ~/src/riffsheet pull && ln -s ~/src/riffsheet/skills/riffsheet ~/.claude/skills/riffsheet

For Codex, the same with ~/.agents/skills. If you had it in both, move one as above; the other is then not needed: set it aside and link the skill folder in its place with mv ~/.agents/skills/riffsheet ~/riffsheet-old && ln -s ~/src/riffsheet/skills/riffsheet ~/.agents/skills/riffsheet, and remove ~/riffsheet-old once the skill works.

Try it

Give your agent a video file and ask in your own words:

Break down this video shot by shot: ~/Downloads/ad.mp4
Why does this TikTok work? I want to make my own version.
Analyze this Reel and list every caption with its timing.

Minutes later you have riffsheet.md to read and riffsheet.json with the data, and your agent tells you in your own language what it found: one plain line per shot, why the video holds a viewer and what your version has to keep. Here is part of one riffsheet from the examples, an 8-second video spoken in Spanish: the agent's own account, with the tool's measured tables put in it, and “…” where words are left out. Read the whole riffsheet.md and its riffsheet.json.

8.042 s · 4 shots · one picture at a time · spoken on camera (es) · 4 spoken lines

Shot Time How it comes in Sound at the change
S2 2.375–4.125 s cut; same framing, same size (the background in place) none on it; nearest drop 2.24 s (-0.13 s)

S2 (2.375–4.125 s). A hard cut changes only her clothes: … The woman, in the same spot of the same white room by the glass door, now wears an oversized cream crewneck sweatshirt with one large photographic red apple printed across the front, and slim straight-leg medium-blue jeans: loose on top, fitted below. … Her brows are drawn together and her head tilts, a skeptical frown through the whole shot. From 3.750 s, as she says "no", the raised finger tilts side to side, a finger wag, until the cut. …

Caption Words On Off Times from
c2 “holgado con ajustado” 2.542 s 4.125 s measured (T4-T5)
  • Every positive verdict gets the same drawn mark at the same place, appearing a quarter to half a second before the verdict is said; the negative gets a clearly negative face and gesture and no positive mark.

Examples

Two runs of this release by fresh coding agents, on videos of ours, each with the account and the readings file the agent wrote, the commands it ran and four of the pictures it worked from. Nothing the agents wrote was edited, and replaying each one's commands rebuilds its riffsheet byte for byte. Each example's README says what to look at first and what the run shows.

A frame from the red-carpet example A frame from the outfit-rules example
red-carpet: 12 s, edited to music, nobody speaks on camera. Speech recognition, left to choose the language, returned a stock Korean phrase; run again in English, it returned “Sorry, I cannot hear you. I'm kind of busy”. The agent checked her mouth on every word (closed) and set the words aside as a voice in the soundtrack. The tool finds 3 shots, joined by a fade and a hard cut, and two flashes over one framing that start no shot; both shot changes and both flashes land on a loudness peak or rise, against about 0.7 by chance. outfit-rules: 8 s, Spanish spoken to camera, captions. 4 shots, 4 spoken lines, a check-mark emoji for each “yes”. 0 of 3 cuts land on a loudness peak or rise (about 1.1 by chance), and 2 of 5 caption appearances do (about 1.8 by chance). Seven of the eight line starts and ends are measured on her voice. Whether a sound stays up under it, the tool cannot tell, so at the eighth and at one word end inside a line it keeps the recognizer's time, marked ~, and lists the time the sound gives.

What you get

Two files per video, written in English:

  • riffsheet.md, the agent's account of the video for a person to read, with the tool's measured tables in it: what happens; each shot, with every shot change and how it comes in; every spoken line with its times, speaker, rate and pauses; every caption cue and graphic with its on and off time to the millisecond; the sound's measures and what the agent infers they are; why it holds a viewer and what a remake has to keep; and, where the agent read a time on frames, how it compares with the tool's own.
  • riffsheet.json, the data: the account, every spoken line with its times, pace and words, every caption with its cues, times, position, size and colors, every graphic with its box and times, the sound's measures, where sound events fall on the shot changes, flashes and caption appearances, and where each value came from. The format is in schema/riffsheet.schema.json.

If you ask for the whole account in your language, the agent also writes riffsheet.zh.md (or .es.md, .ja.md and so on) from riffsheet.md: every time and number unchanged, and the spoken lines and on-screen words left in the video's own language.

How it keeps to what is on screen

  • Measured where a measurement is possible. Cut times, the frame on which each caption appears and the frame on which it is gone, and how the camera moves are measured from the frames; loudness, where each spoken word starts and ends, and the pace of each line, from the sound. Where the evidence does not settle a measurement, the tool leaves the value out and says not measured; for a word's start or end, it keeps the speech recognizer's time and marks it ~.
  • The agent's readings are set against the measurements, never overruled. Where the agent reads a time on frames (a caption shown a word at a time, an arrow that fades out), the tool sets it against its own edge for the same item and says whether the two agree, differ by so many frames, or the time is not measured there. The agent's reading stands, and riffsheet.md lists every difference. The tool never reads the agent's words.
  • What a sound is, inferred and said so. The tool measures the sound; the agent infers from the numbers what it is (a voice alone, a room's own noise, a music bed, an added effect) and says it is inferred.
  • It says what did not run. If speech recognition was not set up, or failed, the riffsheet says with the spoken lines that the speech was not transcribed and why; it never reads as a video without speech. A transcript from another recognizer is marked as such.
  • Nothing to install but ffmpeg. Plain Python, standard library only. No model download is needed; speech recognition is optional.
  • It explains why the video works. What each beat does for the viewer, and what a remake has to keep, as tests a remake can pass.

The procedure the agent follows is references/METHOD.md; each command is described in references/TOOL.md.

How accurate it is

Measured on 0.4.0, on ten short videos (8 to 45 s; eight in English, one in Chinese, one in Korean). Each video was broken down once by each of five coding agents, all running Claude models: Opus and Sonnet with this release, each alone with no tool, and Opus with release 0.3.2. Every breakdown was scored blind, fact by fact, against an answer key for the video, the same for all five, built from frame-by-frame and sample measurement: 1,055 facts in all, about cuts, on-screen text, graphics, speech, sound, what is seen and the camera. Method, every table and the limits are in EVAL.md.

breakdown by correct wrong wrong among the statements made
Opus with 0.4.0 856 16 1.7%
Opus alone 791 25 2.8%
Opus with 0.3.2 686 20 2.2%
Sonnet with 0.4.0 553 51 6.2%
Sonnet alone 247 123 18.5%

On the six videos that played no part in developing 0.4 (643 facts): Opus with 0.4.0 524 correct and 12 wrong, Opus alone 482 and 15, Opus with 0.3.2 464 and 11, Sonnet with 0.4.0 358 and 28, Sonnet alone 165 and 67. On the ten videos, with 0.4.0, Opus stated at least as many correct facts as alone in every category, and as many in cuts and in speech (64 and 67); on the six held out alone it stated one sound fact fewer (79 against 80). It stated fewer correct facts than Opus alone on one of the ten videos. One run of each agent on each video was scored: for Opus and Sonnet with 0.4.0, the latest: on the two videos whose measurements 0.4.0's last change to them alters, runs with that change, and on the other eight, runs of the build before it, whose measurements there are the same (for Sonnet on one video, an earlier run). After these runs the release changed only two labels in riffsheet.json; rebuilt with it, every scored run's riffsheet.md comes out byte for byte the same. Two runs of one agent on the same video have differed by up to 19 correct statements; the tie in speech and the held-out sound count rest on statements that varied between runs, and the tie in cuts follows a correction to one video's key, made while these runs were scored, that took a correct cut from Opus alone. The scorers and the makers of the keys are Claude models too, so they can share the agents' blind spots, and facts are not weighted: a color and a cut time count the same.

Earlier measurements of the tool alone, on cuts (24 of 25 hard cuts on six videos, measured on 0.1.0) and on caption times (on 0.3.2, with a box close around the captions, 243 of 245 appearances and disappearances within one frame), are in EVAL.md; they were not measured again on 0.4.0.

What it cannot do

  • Hear, by itself. The tool measures loudness, word times, the sound's bands and pauses, and where sound events fall on the shot changes, flashes and caption appearances, but not what a sound is. The agent infers that from the measurements and says it is inferred. An agent whose model takes sound as input may say it heard something, and nothing in the tool checks that: what it says it heard is its account, not a measurement, and how accurate such accounts are has not been scored. At our request someone ran an earlier release's hearing path with a coding agent whose model takes sound as input, on the red-carpet video (#11): beside pictures of flashes it named camera clicks, and when its model was given only the sound, it no longer did. Separately, we ran two larger speech recognition models, given no hint, and both found the longer phrase the agent heard sung, word for word. Speech recognition can return words where nobody speaks: the tool flags those the recognizer itself rates as possibly not speech, and the agent checks the mouth and sets them aside (the red-carpet example). Words without the flag can still be music. Without speech recognition there are no spoken lines at all.
  • Time every word over music or room noise. The tool measures where each word starts and ends on the sound. Between two words with nothing quiet between them, it keeps the speech recognizer's time, marked ~. Where a steady sound stays up under the voice (in at least half the pauses, within 20 dB of the speech and above -50 dBFS), music or a room's own noise, it keeps each edge it measured only where the voice stands out of that sound on both sides of the edge: of what lies in the pause beyond it, and of the level the sound holds in the pauses, which it takes to lie under the voice too. Elsewhere it keeps the recognizer's time, marked ~: a beat touching a word, music or a breath about as loud as the voice there, music ducked under the voice or cut right after it. Where a pause lies so near either line that the count could fall either way, the summary says it cannot tell whether the sound stays up, sets the edges against it as if it does, and lists the time the sound gives each edge it kept for it. A breath, a beat or a click just before or after a word's voice, inside the span the recognizer gives the word, is still taken as the word's start or end, and so is music swelling or an effect on a cut right at a word's edge. Where a line's start or end matters and is marked ~, the procedure has the agent read it on frames. In red-carpet every word time is the recognizer's: its words, set aside as not speech, lie under music. In outfit-rules, a voice alone over what the agent infers is a low recording floor, the tool cannot tell whether that floor stays up under the voice; it measures 16 of the 34 word edges on the voice, and keeps the recognizer's time at two word ends where the voice does not stand out of the floor, listing the times the sound gives them (4.01 and 7.32 s, against 3.96 and 7.22 s). The benchmark's runs of 0.4.0 were made again with this measure: on a video with music under the voice, where runs made before it kept four of six line times 0.2 to 0.4 s off, five of the six lines now start and end within 0.2 s, and the other one ends 0.26 s late, unmarked, where music right after the last word, across a picture cut, was taken as the voice.
  • Read text by itself. The tool finds captions and when they change; the agent reads the words from the pictures. Over a picture that holds still, the tool often cannot tell a caption from the picture behind it: it then says which seconds its search for captions that stay up did not cover and why it could not measure a caption's style, and the agent gives its own reading and says so.
  • Catch every edit. A jump cut inside one framing is found when a tenth of the picture or more changes in one frame while the rest holds, and keeps its colors: on a 45-second talking video in one locked framing, 10 of its 11 jump cuts, one of them uncertain (7 before this release). Smaller jumps are flagged for the agent or not found, and so is a jump hidden under a flash; a different outfit, person or object faded in over the same background is not detected; a slow dissolve can be missed. A flash is told apart from a change of picture only when the whole change takes two or three frames; a longer one counts as a shot change. references/TOOL.md lists every known limit.
  • Handle long videos well. It is made for clips up to about a minute and was tested on clips of 8 to 45 seconds. A longer video runs with its overview pictures spaced further apart, and past three minutes the tool warns what will be slow.
  • Fetch videos from a link. Give it the file.
  • Check what the agent writes. The tool checks only the times the agent reads, against its own. The account in riffsheet.md is the agent's own writing, in English whatever language you ask in; its report in your language, and a translation if you ask for one, are its own writing too, and where they differ from riffsheet.md, riffsheet.md is right. The video can be in any language: its spoken lines and on-screen words are kept as they are.

Time and cost

Most of the time is the agent's. On the ten benchmark videos (8 to 45 seconds), Opus with this release took a median of 8.75 minutes per video (7 to 13.4), a little longer than Opus with no tool (median 8, 5 to 11) and less than Opus with 0.3.2 (median 13.25, 9 to 15); Sonnet with this release took a median of 8.5 (3 to 12). These are the runs' own reports: most Opus runs timed themselves with the shell clock, most Sonnet runs estimated. The two examples took about 10 and 6.5 minutes, with 29 and 24 of the tool's commands and 25 and 18 images opened. The cost in agent usage comes mostly from the images it opens and the number of steps, so the procedure batches them, and the tool prints each image's size and estimated token cost; token use was not measured on the benchmark.

From the sheet to your own version

A riffsheet tells you what each beat does and what your version has to keep. Captions, cards, graphics, timing and the edit can be rebuilt with code (ffmpeg, a script) or in a video editor, from the measured times, boxes and colors. Footage of people, places and products cannot: it needs a camera or a video model.

Riffkit makes that footage from your original video, with a free start. You give Riffkit the video file or a TikTok link, and it analyzes the video itself, sound included. Swap keeps the shots and changes who or what is in them; Adapt keeps what made the video work and tells a new story. Riffkit's own skill tells an agent how to use a riffsheet with it.

The two examples, remade with Swap:

The red-carpet video and a hand-drawn animation version of the same shots The outfit-rules video and a version on a beach boardwalk
red-carpet as hand-drawn animation. We have this version only as a comparison picture and make no measured claim about it. outfit-rules on a beach boardwalk. Measured with riffsheet: 2 of 3 cuts and 7 of 10 caption on and off times fall on the same frame as the original's, the rest within one frame (table).

Other things Swap changes, such as a coat's color, or the outfit and the place together:

More Swap results: a coat in a different color, and a different outfit in a different place

Privacy

The tool itself uses no network (except the speech-model download you ask for), needs no account and sends nothing to us; the video, the pictures and the results stay in the folders you choose. What your agent sends to its own model provider, and anything else it proposes to use, is between you and the agent, and the agent says so when it asks.

Questions

Does it work offline? The tool does: once the optional speech recognition is set up, it uses no network. Your agent still talks to its own model provider.

Which agents does it work with? Any agent that can run shell commands and open images: Claude Code and Codex find it as a skill; others can be told to read skills/riffsheet/SKILL.md.

Can it take a link? No. Download the video yourself and give the agent the file.

Can I use it to clone a video? It is made for the opposite: it tells you what made a video work, beat by beat, so you can make your own version with your own people, products and story, not a duplicate.

Who makes riffsheet? The team behind Riffkit, a paid service with a free start that makes new video footage from a video you start from. riffsheet is separate: it runs on your machine, needs no account and sends us nothing. The MIT license lets you use it for anything.

Requirements

  • ffmpeg and ffprobe, version 7 or newer, built with freetype (the labels on every sheet use its drawtext filter), on your PATH. On Linux, use your package manager (Debian's and Ubuntu's ffmpeg have it). On macOS, Homebrew's ffmpeg formula lacks it: install ffmpeg-full, which Homebrew keeps out of its own bin folder (keg-only), and put its bin folder first on your PATH, as the second line does in the startup file of zsh, the macOS shell; then open a new terminal and start your agent again:
    brew install ffmpeg-full
    echo 'export PATH="$(brew --prefix ffmpeg-full)/bin:$PATH"' >> ~/.zshrc
    
  • Python 3.9 or newer. The tool itself uses only the standard library.
  • For spoken words (optional): a word-timed transcript. The tool's own path is the faster-whisper package and its small speech model; your agent may use another recognizer, or a transcript you supply in the same format, and the riffsheet then says what made it. python3 -I scripts/riffsheet.py check, run in the skill's folder, says whether they are on this machine, what they would cost (the package about 64 MB to download and 207 MB on disk, measured on macOS; the model 486 MB, once) and prints the commands that set them up in a virtual environment of their own, ~/.riffsheet/venv, leaving your system Python as it is, and the commands that remove them. The tool never downloads the model on its own: transcribe fetches it only with --download, into the usual Hugging Face cache. Your agent asks you before any of this. Without speech recognition the analysis still covers everything visual and says that the speech was not transcribed.

To check an install, change into the skill's folder (skills/riffsheet in the repository) and run python3 -I scripts/riffsheet.py check. The tests are in the repository, not in the skill's folder: in a checkout, they run from its root with RIFFSHEET_REQUIRE_FFMPEG=1 python3 -B -m unittest (they draw their own test clips with ffmpeg; see CONTRIBUTING.md).

Contributing and license

Wrong readings and bugs go to Issues: there is a template for a statement in a riffsheet that is wrong, one for a bug or install problem, and one for something the tool lacked (what you or your agent needed, and what was used instead). How to run the tests and the rules for changes are in CONTRIBUTING.md; changes are listed in CHANGELOG.md.

If riffsheet is useful to you, a star on GitHub helps other people find it.

MIT. See LICENSE.

About

Video breakdown for coding agents (Claude Code, Codex): your agent analyzes a short video shot by shot on your own machine, with cut, caption, loudness and word times measured. You get a riffsheet: what happens, why it holds a viewer, what your own version has to keep.

Topics

Resources

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages