What does video-vfx-editor do?
You are the editor. Everything runs locally: FFmpeg does the pixels, Python the decisions, Node the motion graphics. There are no paid APIs and no cloud render.
A decision that is not written to a file did not happen. State lives in
edit/state.json, decisions in edit/decisions.md, handoff in edit/handoff.md.
0. Before anything
python install/doctor.py --json— if FFmpeg/libass is missing, follow thefixstring in the error; do not improvise a different stack. If Python is outside 3.11–3.13, runpython install/ensure.py --install --yesonce and use the interpreter it prints for every script.- Work inside the user's project folder. Every script writes only under
edit/. - Never claim a gate passed without running
scripts/check.py.
1. The core loop (edit job)
python scripts/ingest.py "<file|url>" --json
python scripts/probe.py "<ingested>" --quick --json
python scripts/intake.py --json # ask these 5–8 questions in chat
python scripts/plan.py "<probe.json>" --json
python scripts/cut.py "<source>" --json
python scripts/asr.py "<cut>" --lang hi --json
python scripts/caption.py "<cut>" --lang hi --json
python scripts/audio.py "<cut>" --json
python scripts/export.py "<audio>" --json
python scripts/check.py "<export>" --json
forge.py runs this for you and refuses to skip stages:
python scripts/forge.py init "<file>" --job edit --json
python scripts/forge.py next --json # exact next command
python scripts/forge.py run --json # run to the end (stops on failure)
python scripts/forge.py resume --json # ≤1.5k-token brief for a fresh model
python scripts/forge.py status --json
If a stage fails three times on the same cause, stop and ask the user with the two most likely causes. Never loop silently.
2. Intake — ask 5 to 8 questions, never more
intake.py --json returns the bank with detected defaults already filled
from probe.py --quick, plus a reasons map. Present it as a numbered list with
defaults marked; accept "ok".
Ask about: job (edit/clip), format/playbook, aspect, caption language, caption
look, pace, audio treatment, extra effects. Do not re-ask anything answered in
edit/decisions.md.
Defaults that matter: captions Hindi (Devanagari), aspect 9:16 for shorts/reels, loudness −14 LUFS (−16 podcast), true peak ≤ −1 dBTP.
3. Job type clip (long video → 3–10 vertical clips)
python scripts/forge.py init "https://youtu.be/..." --job clip --json
python scripts/forge.py run --until plan --json
# ingest needs --acknowledge-rights for URLs (YouTube ToS)
plan.py writes candidates.json and prints a compact table (≤30 rows) with
five signals: speech, pace, hook, self-containedness, external position.
You rank it, the user approves. Then:
python scripts/forge.py approve 1 4 7 --json
python scripts/clips.py --from-plan --json
clips.py writes clip_NN.mp4 + .srt + .jpg + .json + manifest.json +
review.html under edit/out/run-<id>/. --rules gives a deterministic
fallback ranking. This measures clip strength, not virality — say so.
4. What to read, and only when
| Situation | Read |
|---|---|
| green screen / uneven lighting | references/chroma-key.md |
| no green screen, cut the person out | references/person-matte.md |
| captions look wrong, Hindi shaping, karaoke | references/captions.md |
| audio noisy, humming, ducking, loudness | references/audio.md |
| platform limits, bitrate, duration | references/platforms.md |
| question bank, presets, detected defaults | references/intake.md |
| choosing clip windows | references/clipping.md, references/clip-scoring.md |
| "train the skill on these links" | references/style-learning.md |
| motion graphics, kinetic type | references/motion-graphics.md |
| sound effects, risers, whooshes | references/sound-design.md |
| free b-roll / stock images + credits | references/stock-media.md |
| resuming on a fresh model | references/continuation.md |
| anything failing | references/troubleshooting.md |
| format-specific recipe | references/playbooks/<name>.md |
5. Contracts every command obeys
--jsonprints one JSON object on stdout; logs go to stderr.- Envelope:
status,stage,output,artifacts,checks,next,error,device,duration_ms. status∈ok | warn | fail. Exit0/2/3/4/5/6= ok/warn/failed check/needs user/missing capability/invalid input.- Errors carry
kind,detail,fix,doc,retryable. Quote thefixverbatim to the user, per OS. --dry-runprints every FFmpeg command and writes nothing.--device auto|cpu|cuda|mps(envVFE_DEVICE). GPU OOM retries once on CPU.
6. Device policy (do not re-derive)
auto → CUDA → MPS → CPU. faster-whisper: float16 on CUDA, int8 on CPU
(there is no MPS path). Torch matte: cuda/mps, float32 CPU with
--mask-res 540 --every 2. FFmpeg: h264_nvenc / h264_videotoolbox only when
probed present, else libx264. earshot is CPU-only by design.
7. Gates — nothing is done until these pass
- duration / aspect / fps as planned
- loudness −14 or −16 LUFS ±1, true peak ≤ −1 dBTP
blackdetect+freezedetectat cut points- caption safe zone, ≤32 chars/line, 2–4 words
- contact sheet generated (
sheet.py) and actually looked at - platform spec PASS/WARN/FAIL with a fix per FAIL
- chroma: matte coverage 65–85 %, white and black previews
- clip gates: hook ≤1.5 s, sentence-aligned start/end, subject inside crop
- motion gates: frame-diff energy, no text overflow
- style deviation report when a profile is active
check.py returns FAIL + a fix; do not report success when a gate fails.
8. Style learning
Trigger: "train skill video-vfx-editor on these links" (3–5 references).
python scripts/style.py learn a.mp4 b.mp4 c.mp4 --name <name> --json
python scripts/style.py apply --name <name> --json
python scripts/style.py compare out.mp4 --name <name> --json
Measure, never describe. Confidence tiers: <10 samples low, 10–15 medium, 15+ high — print the tier next to every number. Ask at most 3 questions afterwards (font, music level, reels-only). Never copy the reference music or re-upload reference files.
9. Chroma and person matte
python scripts/chroma.py green.mp4 --bg bg.jpg --json # sample→key→sweep→despill→QC
python scripts/matte.py person.mp4 --bg studio.jpg --preview --json
python scripts/textbehind.py person.mp4 --mask mask.mov --text "TITLE" --json
chroma.py samples the real border colour (k-means), sweeps similarity × blend
for 65–85 % coverage, despills after the key, and writes white + black previews.
Never hand-tune a default without looking at the previews.
10. Reframe + virtual camera
python scripts/reframe.py 16x9.mp4 --aspect 9:16 --json
Face tracking every 3rd frame at 360p, 5-frame median, 40 px/frame clamp,
scene-cut reset, contain + blur fallback when no face or the subject would
leave the crop. Keyframes land in virtual-camera.json. Zoom ≤1.25×, 180–320 ms.
11. House rules
- Ask the user only for: a wrong repo/owner, a licence decision, or permission for a system-level install. Everything else: decide, write it down, continue.
- No paid APIs, no cloud render, no telemetry, no accounts, no watermarks.
- No silent fallbacks: warn, error with a fix, or ask.
- Keep
edit/out of version control; never commit media, models, node_modules. - Finish a turn with: what was produced, which gates ran (with numbers), what was not tested, and the exact next command.