shotrunner turns a shot list into takes that are ready to cut in Final Cut Pro, with one command per provider. It is the handoff from AI generation to the edit, and nothing else: no prompt writing, no picking takes, no UI. As of commit 60bbd96 all milestones (M1 to M6) have passed and it has carried one real scene (1939½, N3 stairwell) from plates to a cut.
For each shot in the list, shotrunner run:
- Reads the shot list (YAML) and the model catalog (
models.yaml). - Plans every take, prices it from the catalog, and refuses the whole run if the total is over your
--budget. Nothing is sent until the plan passes. - Sends each take to the provider (fal, ElevenLabs, or a local ComfyUI) and logs prompt, seed, model, parameters, cost and request id to SQLite.
- Downloads the original the moment it exists and keeps it untouched, with its SHA-256.
- Transcodes video to ProRes 422 at the project frame rate (bt709, timecode 00:00:00:00), and audio-only takes to 24-bit 48 kHz WAV padded to whole frames.
- Writes one FCPXML 1.14 file: an event with every take (keywords, the prompt as a note) and a stringout project with every take in shot order and a marker on each clip (
take=N seed=S cost=C model=M).
A second run of the same list is free: finished takes are skipped, unfinished ones are picked up again by request id.
1. Requirements
shotrunner runs on one Mac with Apple silicon. There is no Intel, Linux or Windows support.
| Need | What | Notes |
|---|---|---|
| Mac | Apple silicon, macOS | The M5 Max is the reference machine. |
| Python | 3.11 | Managed by uv; you never call python for shotrunner directly. |
| uv | Astral’s uv | Creates the environment and runs every command (uv run …). |
| ffmpeg, ffprobe | Homebrew, at /opt/homebrew/bin/ | Called by full path. Tested on ffmpeg 9.0.1. |
| xmllint | Ships with macOS | DTD validation of every FCPXML. |
| Final Cut Pro | 12.3, the Creator Studio build | The app is named “Final Cut Pro Creator Studio”. Import is the ground truth. |
| fal account | API-scope key named shotrunner | Prepaid credits, auto-recharge off. Video: Kling, Veo, Seedance, Wan. |
| ElevenLabs account | Creator plan, key named shotrunner | Sound effects and dialogue. Lossless output needs the Pro plan. |
| Local ComfyUI (optional) | 0.37.0 at http://127.0.0.1:8190 | Free local Wan 2.2 and LTX-2.5. Slow: minutes per clip. |
| Media space | A folder you keep for the whole project | Never /tmp: macOS wipes it on restart. |
| GitHub access | The private repo rafabenedetti/shotrunner | Ask Rafa to add your GitHub account. |
Keys live only in the macOS Keychain under the names FAL_KEY and ELEVENLABS_API_KEY. They are exported by hand in the Terminal tab that runs a live job, never in .zshrc, and never written into a shot list, the database, logs or the FCPXML.
2. Installing
Installing takes five steps and ends with the test suite passing. Run each block in Terminal and check its output before the next.
-
Tools. Install ffmpeg and uv with Homebrew, then check both:
brew install ffmpeg uv /opt/homebrew/bin/ffmpeg -version | head -1 uv --version -
The repo. It’s private on GitHub (
rafabenedetti/shotrunner), so clone it while signed in to GitHub:git clone https://github.com/rafabenedetti/shotrunner.git ~/Developer/shotrunner cd ~/Developer/shotrunner git --no-pager log --oneline -1 -
The gate. The first
uv runbuilds the environment from the pinned versions. The suite runs with the network blocked and never spends money:cd ~/Developer/shotrunner uv run pytest -q uv run shotrunner --helpExpect
174 passed(the count at60bbd96; it only grows). The Apple FCPXML 1.14 DTD lives in the repo atvendor/fcpxml/FCPXMLv1_14.dtd; a missing DTD is a failing test, never a skip. -
Keys. Store each key once in the Keychain.
securityasks for the value, so it never lands in your shell history:security add-generic-password -a "$USER" -s FAL_KEY -w security add-generic-password -a "$USER" -s ELEVENLABS_API_KEY -w -
Each live session. In the Terminal tab that will run paid takes, and only there:
export FAL_KEY="$(security find-generic-password -s FAL_KEY -w)" export ELEVENLABS_API_KEY="$(security find-generic-password -s ELEVENLABS_API_KEY -w)" echo "FAL_KEY ${FAL_KEY:+is set}; ELEVENLABS_API_KEY ${ELEVENLABS_API_KEY:+is set}"
For local ComfyUI, start it in its own tab (comfy-v, port 8190). shotrunner reads COMFYUI_URL and COMFYUI_TIMEOUT_S from the environment if you need other values.
To update later: cd ~/Developer/shotrunner, git pull, uv run pytest -q. Only run paid takes on a green gate.
3. The commands
There are three commands: run, verify and cost. Always run them from ~/Developer/shotrunner with uv run. Check flags with --help before trusting a guide, this one included.
shotrunner run
uv run shotrunner run SHOTLIST --provider PROVIDER --out DIR [--live --budget DOLLARS] [--retry-failed] [--workers N] [--models FILE]
| Flag | What it does |
|---|---|
SHOTLIST | The shot list YAML. Image paths inside it are relative to this file. |
--provider | One of fal, elevenlabs, comfyui, fake. One provider per run; shots for other providers are skipped and named. |
--out | Where the .sqlite and the .fcpxml go ({out}/{project}.sqlite, {out}/{project}.fcpxml). Media never goes here. |
--live | Allows a paid provider. Without it only fake works. |
--budget | Hard dollar cap for this run, required with --live. The plan is priced first; over the cap, nothing is sent. Use 0 for local ComfyUI. |
--retry-failed | Also resubmits takes that failed. Without it, failed takes are left alone. |
--workers | Takes in flight at once. Each provider has its own cap (fal 2, ComfyUI 1). |
--models | Another model catalog than models.yaml. |
Exit codes: 0 done; 1 refused (no --live, a plan-time refusal such as a missing image or a duration a model can’t make, or a failed take); 2 over budget, nothing sent; 3 media on disk that this database doesn’t own, nothing sent.
shotrunner verify
uv run shotrunner verify OUT/PROJECT.fcpxml
Checks the FCPXML against Apple’s DTD and the project’s FCPXML rules, checks every media file exists and matches the database, checks the stringout adds up in exact frames, reads it back through OpenTimelineIO, and runs ffprobe on every ProRes and WAV (bt709, size, rate, channels). Expect OK: … (0 problems; DTD, rules, media, spine, database, OTIO round trip). Import nothing that fails verify.
shotrunner cost
uv run shotrunner cost OUT/PROJECT.sqlite
Prints every take with status, model, seed, the estimated cost and the provider’s own billing unit (billed, never summed), then total (done). Failed takes show their estimate but are left out of the total. Check real spend against fal’s usage CSV and the ElevenLabs dashboard.
4. The shot list and the catalog
A shot list is one YAML file per project. Keep it next to its plates, outside the repo. This is the shape that ran the N3 scene, cut to two shots:
project: 1939h_n3_stairwell # plain ASCII; names the .sqlite, the .fcpxml and the media folder
fps: 24 # 24, or 23.976
resolution: 1920x1080 # the FCP project format
media_root: /Users/you/Movies/1939h_shotrunner_test # absolute, ASCII, never /tmp; set once
defaults: {model: klingo3_i2v, takes: 2}
shots:
- id: sh010b
scene: n3_stairwell
prompt: "A tired woman in her forties in a gray usherette uniform sits on a concrete step... The camera does not move."
image: plates/N3-Stairwell-Closed.png # start frame, relative to this file
duration_s: 5
seed: 111 # take N uses seed + N - 1
keywords: [n3, ara, face]
- id: sh010fx
scene: n3_stairwell
model: el_sfx
takes: 1
prompt: "Slow chewing of a bread sandwich and the crinkle of its waxed-paper wrapper, in a small concrete stairwell."
duration_s: 5
keywords: [n3, sfx]
Other fields: refs: (reference images, in order, for reference-to-video entries; Seedance prompts cite them as @Image1), a top-level voices: mapping names to ElevenLabs voice ids with voice: on a dialogue shot (see examples/smoke_elevenlabs.yaml). A dialogue shot takes no duration_s of its own; a sound-effect shot needs one. The stringout follows shot order, so put each effect right after its shot and give it a matching id: sh010, sh010b, sh010fx, sh020. Quote any value that is on, off, yes or no, or YAML reads it as true or false.
Models you can name
The catalog is models.yaml in the repo; prices there drive the budget guard. These are the entries proven live (prices per requested second unless noted):
| Model key | Provider | Kind | Price | Lengths | Faces | Frame |
|---|---|---|---|---|---|---|
klingo3_i2v | fal | image-to-video | $0.084/s | 3 to 15 s | Holds the plate’s face | Keeps the plate’s shape, about 720p area (21:9 → 1472x624) |
veo31_i2v_silent | fal | image-to-video | $0.20/s | 4, 6, 8 s | Holds to three-quarter | 1920x1080 16:9 only |
veo31_silent | fal | text-to-video | $0.20/s | 4, 6, 8 s | Its own faces | 1920x1080 |
seedance25_i2v_720p | fal | image-to-video, with sound | $0.473/s | 4 to 30 s | Refused | Follows the plate’s shape |
kling3_pro | fal | text-to-video | $0.112/s | see catalog | Its own faces | 1080p |
wan22_480p, wan22_720p | fal | text-to-video, 16 fps | $0.04/s, $0.08/s | see catalog | Its own faces | 832x480, 1280x720 |
el_sfx | elevenlabs | sound effect | $0.12/min | any | n/a | WAV |
el_v3_dialogue | elevenlabs | dialogue | $0.10 per 1k characters | from the line | n/a | WAV |
wan22_i2v_q8_lightx2v_local, ltx25_i2v_q8_local | comfyui | image-to-video, local | $0 | on each model’s frame grid | Untested | 832x480, 768x448 |
The catalog also holds Seedance 2.5 reference-to-video and Seedance 2.0 Mini draft entries; read models.yaml for their names and prices. A model missing from the catalog is refused. An entry older than 45 days prints a price warning on live runs: re-check the vendor’s page and update checked_on.
5. Using it on a scene
A scene goes from brief to picks in FCP in nine steps; the N3 stairwell took about an hour of running and $4.03. Spend money only at steps 5 and 6, and only after a free check.
-
Brief. Write the scene brief in the film’s own project: per shot, what happens, the prompt, whether a readable face is in frame, the start plate, the length, and the sound. Add the face angle, the plate’s state at frame 0, and the number of actions (see the rules below).
-
Plates. Export the locked plates and put them in
{media_root}/plates/. PNG is safest; convert a webp losslessly withffmpeg -i plate.webp plate.png. Check sizes with ffprobe. 21:9 is fine for Kling; Veo needs 16:9. -
Shot list. Write
{media_root}/{project}.yaml. Route each shot: faces toklingo3_i2v(orveo31_i2v_silentfor a 16:9 hero plate), no-face shots to Kling or Seedance, effects toel_sfx. Leave out shots that are better as a still in the edit. -
Free check, per provider. Run with
--liveand a budget too small to pass. It must endexit 2, show the plan and the estimate, and write no media:cd ~/Developer/shotrunner SL=~/Movies/1939h_shotrunner_test/1939h_n3_stairwell.yaml DB=~/Movies/1939h_shotrunner_test/db uv run shotrunner run "$SL" --provider fal --live --budget 0.10 --out "$DB"; echo "exit $?" uv run shotrunner run "$SL" --provider elevenlabs --live --budget 0.001 --out "$DB"; echo "exit $?"Any refusal other than the budget (a missing image, a length the model can’t make, a plate outside Kling’s limits) shows here, for free.
-
One test take when something is new (a new model, a new aspect, a new kind of shot): a one-shot, one-take copy of the list with the same
project,media_rootand--out. The full run later counts it as done. -
Full run, once per provider, into the same
--out, with a real budget a little over the estimate:uv run shotrunner run "$SL" --provider fal --live --budget 3.20 --out "$DB"; echo "fal exit $?" uv run shotrunner run "$SL" --provider elevenlabs --live --budget 0.10 --out "$DB"; echo "elevenlabs exit $?" -
Check.
verifythe FCPXML (0 problems), printcost, and make contact sheets and last frames to judge faces and continuity before you open FCP:uv run shotrunner verify "$DB"/1939h_n3_stairwell.fcpxml uv run shotrunner cost "$DB"/1939h_n3_stairwell.sqlite -
Import.
open -a "Final Cut Pro Creator Studio" "$DB"/1939h_n3_stairwell.fcpxml. Expect no warning dialog, every take in the event with keywords and its prompt as a note, and the stringout in shot order with a marker per clip. A re-import makes a second event, so delete the old one first. -
Pick and iterate. Judge every face against the character’s hero and sheet. A take that fails is fixed with a new shot id and a new prompt or plate, never by rerunning the old id. Compare the bill with fal’s usage CSV the same day.
Keep shell lines short (use variables as above). A long line pasted into zsh can split in two and run half a command.
6. Rules learned the hard way
Every rule here cost a take or more to learn; the full record is in docs/failures.md.
- The angle rule. The plate must show the face at the angle the shot needs. A model invents any angle it wasn’t shown, and at small sizes it invents someone else (N3 sh010: a younger woman the moment Ara lifted her head).
- State the real age. Prompts describe a character’s age as the bible does. “Young woman” for a woman in her forties pulls the face younger.
- The plate is frame 0. Hands, props and costume in the plate must match the shot’s start. If the plate and the continuity notes disagree, fix one before writing the prompt.
- One or two actions per shot. About one clear action per 3 s. Four actions in 6 s ends mid-action.
- Camera moves aren’t reliable. Write “The camera does not move” and expect small drift anyway; stabilize or crop in FCP. Do real moves in the edit.
- Lettering gets redrawn. Keep printed words still, or re-comp them from the locked prop.
- No faces on Seedance. Seedance 2.5 on fal refuses any photoreal face, invented or not (422
partner_validation_failed, not billed), on both its global and US tiers. - Kling keeps frame 0; Veo re-renders it. For a cut that must match a still exactly, use Kling.
- A new direction is a new shot id. A changed prompt is a new take, but the old clip names are on disk, so the runner refuses the old id (exit 3). Use
sh010b; the old takes stay in the event. - One
media_rootper project, set once. Moving it, or running a second--outagainst it, is what exit 3 protects against. - Exclusions can’t be sent as a negative prompt. Putting “Avoid red” in the prompt tends to add red. Check for it in each take instead.
7. Where things land
Media goes under media_root; only the database and the FCPXML go under --out. The clip name {shot}_tk{NN} is a take’s identity on disk and in FCP.
| What | Path |
|---|---|
| Originals, untouched, with the provider’s JSON beside them | {media_root}/{project}/originals/{shot}/ |
| ProRes 422 for video takes | {media_root}/{project}/prores/{shot}/{shot}_tk{NN}.mov |
| WAV for dialogue and effects | {media_root}/{project}/audio/{shot}/{shot}_tk{NN}.wav |
| Database (every take, request id, cost, SHA-256) | {out}/{project}.sqlite |
| FCPXML (event and stringout) | {out}/{project}.fcpxml |
In FCP each take carries keywords (shot id, scene, provider, model, your own keywords) and its full prompt as a note; its stringout clip carries a marker on frame 0 with take, seed, cost and model. A clip whose size isn’t the project’s (Kling’s 1472x624, say) gets its own format and sits letterboxed in the 1080p stringout. Video with sound and dialogue take the dialogue role; effects take the effects role.
Back up the originals folder with the project. The database’s SHA-256 of each file is how the runner knows the media is its own.
8. Troubleshooting
Read the whole message first; shotrunner names the shot, the file or the limit it refused on.
| Symptom | Cause | Fix |
|---|---|---|
exit 1 and nothing sent, on a paid provider | --live missing | Add --live --budget N. |
over budget: … Nothing submitted (exit 2) | The plan costs more than --budget | Raise the budget, or cut takes. It leaves planned rows behind; the next run submits them. |
exit 3, files named “not owned” by this database | Those media files belong to another database, or a changed prompt reuses an old clip name | Rerun with the --out that holds the project’s database, or give the new direction a new shot id. Never delete media to get past it. |
skip sh010fx: el_sfx belongs to elevenlabs | Normal: one provider per run | Run again with that --provider, same --out. |
--provider: expected one argument | A pasted long line split in two | Use short lines with shell variables. |
| An image-to-video shot refused at plan time | No image: on the shot, or the file isn’t there | Add the plate path, relative to the shot list. |
| Kling refuses a plate | Under 300 px a side, aspect outside 0.4 to 2.5, over 50 MB, or unreadable (“ffprobe found no picture in it”) | Re-export the plate. A 3-byte or broken PNG reads as 0x0. |
| A length refused, with the nearest valid ones | Veo takes 4, 6, 8 s; local Wan and LTX need their frame grid | Use a listed length and trim in the edit. |
fal 422 content_policy_violation, partner_validation_failed on image_url | Seedance refuses a photoreal face | Not billed. Route the shot to Kling or Veo. |
| A fal error cut off mid-sentence in the database | The runner stores 500 characters | Full text: api.fal.ai/v1/models/requests/by-endpoint?endpoint_id=…&expand=payloads with your API key. |
| The face isn’t the character | An angle the plate didn’t show, or “young” in the prompt | Keep the head near the plate’s angle, or make a plate with the angle; state the real age. New shot id. |
| The take ends mid-action | Too many actions for the length | Split the shot, or cut before the end. |
| The frame drifts | Models ignore “the camera does not move” at times | Stabilize or crop in FCP, or pick the other take. |
| FCP shows media offline | Media moved, or media_root under /tmp or an iCloud-synced folder | Keep media in a fixed local folder; relink in FCP. |
Unable to find application named 'Final Cut Pro' | The Creator Studio build’s name | open -a "Final Cut Pro Creator Studio" … |
| A second event appears in FCP | Re-importing the same FCPXML | Delete the old event first. |
| A price warning on a live run | A catalog entry is over 45 days old | Check the vendor’s page; update price_per_s and checked_on in models.yaml. |
cost total looks low next to the bill | ElevenLabs bills in credits, never summed | Check the ElevenLabs dashboard; fal’s usage CSV for fal. |
The gate fails after git pull | The repo or an adapter changed | Don’t run paid takes. Note the failing test and ask before changing anything. |
| ComfyUI takes never finish | ComfyUI not running, wrong port, or a model not loaded | Start comfy-v (port 8190); check its log for “Prompt executed in”. |
When something new goes wrong, write it in docs/failures.md with the exact error. That file is how the next scene avoids it.