1---2name: motion-render3description: "Use when turning a locked brief and beat map into a film file — deterministic seek(t) scene split into classic scripts (springs, springSum, stagger, density validator, actor, CSS 3D, cursor interaction, pinned lit three.js), zero-dependency Chrome capture, staged render (stills one per beat → draft → master with subframe motion blur, stills by default), ffmpeg mp4 + GIF, VHS terminal films, audio on a measured beat grid, and verification of the delivered file."4versions:5 fuse-motion: "1.0.0"6 ffmpeg: "9.0.2"7 bun: "1.4.2"8 vhs: "0.12.1"9user-invocable: true10references: references/seek-contract.md, references/determinism.md, references/stages-budgets.md, references/encoding.md, references/delivery-github.md, references/vhs-terminal.md, references/verification.md, references/audio.md, references/templates/capture-cdp.md, references/templates/render-cli.md, references/templates/timeline-seek.md, references/templates/interaction-kit.md, references/templates/webgl-scene.md, references/templates/index-skeleton.md, references/templates/vhs-tape.md11related-skills: motion-art-direction, motion-method, motion-craft, motion-assets, motion-review, fuse-design:design-motion12metadata:13 source: https://skillmd.com/skills/fusengine/motion-render14---1516<objective>17The production half of the fuse-motion pipeline: from `.motion/brief.md` and18`.motion/beats.md` (owned by `motion-method`) to a verified file. A film is a pure19function of time — an HTML or canvas scene exposing `window.seek(t)` — captured frame by20frame by headless Chrome over the DevTools Protocol with zero dependencies, then encoded21by ffmpeg (H.264 mp4 + palette GIF). Rendering is staged: `stills` (the default when22`--stage` is omitted, so a forgotten flag can never skip a gate) → owner gate G1 →23`draft` 540p → critic + owner gate G2 → `master`, whose FILE is verified by ffprobe,24frame count, byte budget and SSIM against the approved stills.2526Terminal subjects use VHS tapes; sound, when the brief asks for it, follows the audio27reference. Templates are generalized from the proven `docs/demo/statusline-mod/` and28`docs/demo/hook-sniper.tape` pipelines and were run end to end before shipping.29</objective>3031# Motion Render3233## Agent Workflow (MANDATORY)34351. **Read the locked inputs**: `.motion/brief.md` (surfaces, byte budgets, aspect,36 duration) and `.motion/beats.md` — if either is missing, go back to `motion-method`.372. **Check tools**: `ffmpeg -version`, `ffprobe -version`, `bun --version`, a Chrome38 binary (or `CHROME_BIN`); `vhs --version` + `ttyd` for terminal films. Missing tool →39 say so, never fake a render.403. **Scaffold the scene**: `motion-art-direction` templates FIRST —41 composition-grid (layout), kinetic-type (word behaviours), cut-rhythm (beat map) —42 only after `look.md` and the key frames exist. This skill then adds the mechanics:43 the shell, the `seek` clock, capture and encode (never hand-roll a capture).444. **Render `stills`** → STOP at G1. **`draft`** → `motion-critic` → STOP at G2.45 **`master`** → verify the FILE. The harness `motion` scope denies draft/master until46 the owner types `MOTION-APPROVE` — stop at each gate anyway, never lean on the deny.475. **Hand off**: lead runs `fuse-ai-pilot:sniper` on the scripts and the challenger on48 the "done" claim.4950---5152## Overview5354| Concern | Choice | Reference |55|---------|--------|-----------|56| Scene | DOM, 2D canvas or a WebGL layer with `window.seek(t)`, DURATION, FPS, STILLS, ready; a gesture in progress at every moment (`validateDensity`); look from `motion-art-direction` | [seek-contract.md](references/seek-contract.md) |57| Reproducibility | Time-driven only, seeded PRNG, double rAF, proven vs reported flags; CSS 3D and lit WebGL paths | [determinism.md](references/determinism.md) |58| Stages | stills (default, one per beat) → draft → master, budget log, `--jobs` chunks | [stages-budgets.md](references/stages-budgets.md) |59| Encoding | libx264 yuv420p BT.709 faststart; GIF palettegen/paletteuse; master motion blur from subframes + `tmix` | [encoding.md](references/encoding.md) |60| Delivery | GIF inline + mp4 link on GitHub | [delivery-github.md](references/delivery-github.md) |61| Terminal | VHS tape + scripted demo | [vhs-terminal.md](references/vhs-terminal.md) |62| Proof | ffprobe facts, exact frames, budgets, SSIM, spikes, color tags | [verification.md](references/verification.md) |63| Sound | Licensed track ~120 BPM, beat grid measured from the song, start on a downbeat, SFX by measured peak, -14 LUFS, silent cut | [audio.md](references/audio.md) |6465---6667## Critical Rules68691. **`seek(t)` is pure** — same `t`, same pixels, any order. No CSS animation, no wall70 clock, no unseeded randomness, no state between frames.712. **`--stage` defaults to `stills`** — omitting it cannot skip a gate; unknown values72 exit 2. Pass a literal stage: the harness counts `--stage "$S"` as master. Stop at73 G1 and G2.743. **Verify the file, not the frames** — exact `DURATION x FPS` frames, h264/yuv420p,75 budget, SSIM vs approved stills. "ffmpeg exited 0" is not proof.764. **No invented flags or APIs** — every Chrome/ffmpeg option is either proven by the77 reference pipeline or labelled "reported, verify".785. **Facts from files only** — on-screen numbers from `.motion/facts.md`, labelled example79 data; no client names, no real spend, real masked screenshots (`motion-assets`).806. **Fix in the scene, not with re-renders** — a critic finding is a code change + a new81 draft, never a sequence of masters.8283---8485## Architecture8687```88.motion/89├── brief.md, beats.md, facts.md, assets.json ← motion-method / motion-assets90├── scene/index.html + lib.js, beats.js|rhythm.js, grid.js, kinetic.js, timeline.js91│ ← classic scripts in that order (each within `FUSE_SOLID_MAX_LINES`):92│ index-skeleton.md shell + timeline-seek.md clock93├── capture.js ← capture-cdp.md94├── render.js + encode.js ← render-cli.md95├── terminal.tape + terminal-demo.sh ← vhs-tape.md (terminal films)96├── stills/ still-1..N.png, contact.png (G1 artifact)97├── out/ draft.mp4 (G2 artifact), master.mp4, master.gif98├── review/ review pack (motion-review)99├── work/ frames + Chrome profiles (gitignore)100└── budget.json renders per stage + wall time101```102103→ See [render-cli.md](references/templates/render-cli.md) for the complete CLI104105---106107## Reference Guide108109### Concepts110111| Topic | Reference | When to Consult |112|-------|-----------|-----------------|113| **Seek contract** | [seek-contract.md](references/seek-contract.md) | Writing/porting a scene; GSAP/WAAPI adapters; canvas camera |114| **Determinism** | [determinism.md](references/determinism.md) | Drift, stutter, blank frames, cuts on frame boundaries |115| **Stages & budgets** | [stages-budgets.md](references/stages-budgets.md) | Choosing a stage, long films, render counts |116| **Encoding** | [encoding.md](references/encoding.md) | mp4/GIF settings, color shift, banding, over budget |117| **GitHub delivery** | [delivery-github.md](references/delivery-github.md) | README/docs embedding, size limits |118| **VHS terminal** | [vhs-terminal.md](references/vhs-terminal.md) | Terminal/CLI films |119| **Verification** | [verification.md](references/verification.md) | After every master, before "done" |120| **Audio** | [audio.md](references/audio.md) | Brief asks for music/SFX |121122### Templates123124| Template | When to Use |125|----------|-------------|126| [capture-cdp.md](references/templates/capture-cdp.md) | `.motion/capture.js` — zero-dep Chrome capture |127| [render-cli.md](references/templates/render-cli.md) | `.motion/render.js` + `encode.js` — stages, encoders, verification |128| [timeline-seek.md](references/templates/timeline-seek.md) | The scene split into classic scripts (`lib.js` → `beats.js` → blocks → `timeline.js`): springs ζ ≥ 0.85, `springSum`, `stagger`, `validateDensity` (0.75 s / 1.2 s / 1 per s), the recurring actor, a flat CSS 3D cube; or the dense 2D-canvas scene |129| [interaction-kit.md](references/templates/interaction-kit.md) | One continuous object driven by a cursor: dual-edge springs, click/drag with spring-back, `swapBlur` (≤ 0.1 s, ≤ 8 px), loop seam check |130| [webgl-scene.md](references/templates/webgl-scene.md) | A lit three.js beat: pinned local three r186, SwiftShader, twice-rendered sha256 proof or CSS 3D fallback |131| [index-skeleton.md](references/templates/index-skeleton.md) | `.motion/scene/index.html` mechanics — stage = VIEW, kill-switch, local fonts, hidden shots, actor, rule, CSS 3D cube, script order |132| [vhs-tape.md](references/templates/vhs-tape.md) | Terminal film: tape + scripted demo |133134---135136## Best Practices137138### DO139- Render stills twice when touching the scene's clock: the contact sha256 must not change140- Put hard cuts on frame boundaries (`t = k / FPS`) so a cut lands on the same frame at every rate and in every chunk141- Use `--jobs` past ~25 s; frames keep a global index142- Run the `motion-review` pack (spikes, phone view) on the draft and the master143- Report renders per stage, wall time, sizes vs budgets, SSIM and spikes144145### DON'T146- Capture the preview loop or record the screen in real time147- Add motion blur to stills or the draft — master only, `--subframes` (4 default, ≥ 12 if any move > ~2 % W/frame — encoding.md), cuts on frame boundaries148- Ship a lit WebGL beat without the twice-rendered sha256 proof, or load three from a CDN at render time149- Build a crossfade or dissolve, or an opacity-only entrance — banned (`motion-craft` anti-slop-video.md)150- Write a scene file over the hook ceiling `FUSE_SOLID_MAX_LINES` — split it into another classic script151- Leave frame 0 blank or fading in — `seek(0)` shows the opening statement at full value152- Add a "reported" Chrome flag without the twice-rendered hash test153- Lower the SSIM threshold to make a master pass — investigate the change154- Commit `.motion/work/` frames or Chrome profiles155- Use Remotion as a dependency (license — mention it only as an alternative)156- Copy design-motion's UI micro-durations into film holds — films use `motion-craft` holds