agentcut 0.2.25 → 0.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -148
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -5
- package/dist/config.js.map +1 -1
- package/dist/studio/agents/claude.js +3 -2
- package/dist/studio/agents/claude.js.map +1 -1
- package/dist/studio/chat.js +1 -1
- package/dist/studio/chat.js.map +1 -1
- package/dist/studio/cli.js +40 -21
- package/dist/studio/cli.js.map +1 -1
- package/dist/studio/download.d.ts +24 -0
- package/dist/studio/download.js +234 -0
- package/dist/studio/download.js.map +1 -0
- package/dist/studio/host.d.ts +1 -2
- package/dist/studio/host.js +36 -8
- package/dist/studio/host.js.map +1 -1
- package/dist/studio/housekeeping.d.ts +2 -2
- package/dist/studio/housekeeping.js +18 -17
- package/dist/studio/housekeeping.js.map +1 -1
- package/dist/studio/mcp-guides.js +1 -18
- package/dist/studio/mcp-guides.js.map +1 -1
- package/dist/studio/proc.js +16 -6
- package/dist/studio/proc.js.map +1 -1
- package/dist/studio/proxies.d.ts +4 -0
- package/dist/studio/proxies.js +15 -6
- package/dist/studio/proxies.js.map +1 -1
- package/dist/studio/release-cursor.js +21 -21
- package/dist/studio/release-video.js +10 -10
- package/dist/studio/schema.d.ts +0 -1
- package/dist/studio/schema.js +0 -1
- package/dist/studio/schema.js.map +1 -1
- package/dist/studio/tools.d.ts +0 -4
- package/dist/studio/tools.js +32 -31
- package/dist/studio/tools.js.map +1 -1
- package/dist/studio/voice/kokoro-catalog.d.ts +56 -28
- package/dist/studio/voice/kokoro-catalog.js +56 -28
- package/dist/studio/voice/kokoro-catalog.js.map +1 -1
- package/dist/studio/voice/ming-catalog.d.ts +19 -0
- package/dist/studio/voice/ming-catalog.js +40 -0
- package/dist/studio/voice/ming-catalog.js.map +1 -0
- package/dist/studio/voice/ming.d.ts +12 -0
- package/dist/studio/voice/ming.js +397 -0
- package/dist/studio/voice/ming.js.map +1 -0
- package/dist/studio/voice/previews.d.ts +5 -0
- package/dist/studio/voice/previews.js +50 -0
- package/dist/studio/voice/previews.js.map +1 -0
- package/dist/studio/voice/registry.js +2 -0
- package/dist/studio/voice/registry.js.map +1 -1
- package/dist/studio/voice.d.ts +1 -1
- package/dist/studio/voice.js +5 -6
- package/dist/studio/voice.js.map +1 -1
- package/package.json +56 -56
- package/template/AGENTS.md +14 -14
- package/template/components/README.md +70 -70
- package/template/components/before-after/BeforeAfter.tsx +89 -89
- package/template/components/catalog.ts +107 -107
- package/template/components/cinematic/Device3D.tsx +324 -324
- package/template/components/cinematic/devices3d/display-model.ts +184 -184
- package/template/components/cinematic/devices3d/iphone-model.ts +643 -643
- package/template/components/cinematic/devices3d/macbook-model.ts +608 -608
- package/template/components/cinematic/devices3d/models.ts +657 -657
- package/template/components/cinematic/devices3d/runtime.ts +267 -267
- package/template/components/cinematic/math.ts +100 -100
- package/template/components/color/grade-effect.ts +650 -650
- package/template/components/color/grade.ts +512 -512
- package/template/components/color/looks.ts +154 -154
- package/template/components/countdown/Countdown.tsx +166 -166
- package/template/components/dot-trace-title/DotTraceTitle.tsx +181 -181
- package/template/components/dot-trace-title/meta.json +51 -51
- package/template/components/generate/GenerateReveal.tsx +381 -381
- package/template/components/hook-card/HookCard.tsx +554 -554
- package/template/components/index.ts +199 -199
- package/template/components/lib.ts +191 -191
- package/template/components/line-diagram/LineDiagram.tsx +205 -205
- package/template/components/line-diagram/meta.json +215 -215
- package/template/components/list-card/ListCard.tsx +104 -104
- package/template/components/live-clip.ts +75 -75
- package/template/components/looks.tsx +1447 -1447
- package/template/components/loops/LoopCanvas.tsx +132 -132
- package/template/components/loops/engine.ts +184 -184
- package/template/components/loops/library.ts +667 -667
- package/template/components/loops/library2.ts +777 -777
- package/template/components/motion-loop/MotionLoop.tsx +37 -37
- package/template/components/motion-loop/meta.json +311 -311
- package/template/components/props.ts +73 -73
- package/template/components/quote-card/QuoteCard.tsx +71 -71
- package/template/components/style-layer.tsx +233 -233
- package/template/components/styles.ts +113 -113
- package/template/components/types.ts +66 -66
- package/template/components/word-pop/WordPop.tsx +59 -59
- package/template/components/word-stack/WordStack.tsx +122 -122
- package/template/presets/charcoal-sketch/PROMPT.md +48 -48
- package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -34
- package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -376
- package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -73
- package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -119
- package/template/runtime/composition.tsx +1189 -1185
- package/template/runtime/helpers.tsx +230 -230
- package/template/runtime/index.tsx +22 -22
- package/template/runtime/types.ts +315 -315
- package/template/skill/SKILL.md +186 -351
- package/template/skill/references/broll.md +44 -44
- package/template/skill/references/browser-export.md +61 -61
- package/template/skill/references/cinematic.md +206 -206
- package/template/skill/references/color.md +79 -79
- package/template/skill/references/craft.md +54 -10
- package/template/skill/references/editing-styles.md +57 -57
- package/template/skill/references/feature-launch.md +5 -1
- package/template/skill/references/footage.md +72 -72
- package/template/skill/references/format.md +142 -142
- package/template/skill/references/how-to.md +0 -15
- package/template/skill/references/launch-direction.md +89 -0
- package/template/skill/references/loops.md +151 -151
- package/template/skill/references/mcp-external.md +19 -0
- package/template/skill/references/performance.md +93 -93
- package/template/skill/references/person-cutout.md +19 -19
- package/template/skill/references/presets.md +60 -60
- package/template/skill/references/product-launch.md +4 -1
- package/template/skill/references/release-capture.md +53 -0
- package/template/skill/references/sound.md +167 -155
- package/template/skill/references/style-spy.md +160 -160
- package/template/skill/references/website-howto.md +45 -45
- package/template/starter/.studio/chat.json +1 -1
- package/template/starter/layers.json +46 -46
- package/template/starter/notes.md +4 -4
- package/template/starter/project.json +13 -13
- package/template/starter/scenes/Title.tsx +38 -38
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
# Motion loops, brand palettes and variety
|
|
2
|
-
|
|
3
|
-
Agentcut ships a library of 44 seamless **motion loops** (all live at agentcut.synteq.app/loops),
|
|
4
|
-
each a pure function of time on a 12 s cycle (the frame at 12 s is the frame at 0 s), drawn from the
|
|
5
|
-
brand's colours. Use them so no video sits on a dead flat colour, and so every video looks different.
|
|
6
|
-
|
|
7
|
-
## Use one
|
|
8
|
-
|
|
9
|
-
- **As a clip** (the user can edit it in the inspector): component `motion-loop` on a track under the
|
|
10
|
-
content, e.g. `{ "component": "motion-loop", "props": { "loop": "dot-wave", "tone": "light",
|
|
11
|
-
"accent": "#f97316", "accent2": "#ec4899", "seed": 7 } }`. `agentcut_components` with
|
|
12
|
-
`id: "motion-loop"` lists every loop.
|
|
13
|
-
- **Inside a scene** (behind a cinematic Stage, on a card, in a split):
|
|
14
|
-
`import { LoopCanvas } from "agentcut/components"` →
|
|
15
|
-
`<LoopCanvas loop="iso-cubes" accent={brand} accent2={brand2} tone="dark" seed={3} />`. Without
|
|
16
|
-
`width`/`height` it is frame-sized and stretches to its parent, so use it full-frame (or in a box
|
|
17
|
-
with the frame's aspect). In any other box pass that box's size in px, e.g. on a `Plane` (a great
|
|
18
|
-
card in 3D): `<Plane width={800} height={500}><LoopCanvas loop="dot-wave" width={800} height={500} /></Plane>`;
|
|
19
|
-
then it draws at exactly that size and never distorts. Put it first inside `<Stage>` instead of
|
|
20
|
-
`<Backdrop>`, or on a Plane far behind the devices (`z: -800`) so it parallaxes with the camera.
|
|
21
|
-
- Props: `tone` `dark` (deep brand-tinted background, brand motif), `accent` (solid brand colour,
|
|
22
|
-
ink or paper motif), `light` (paper background, ink motif, brand as the second colour); `speed`
|
|
23
|
-
(seamless at any speed inside a clip; a clip that repeats needs length × speed to be a multiple of
|
|
24
|
-
12 s); `seed` (another layout of the same loop); `transparent` (shapes over footage or a Stage);
|
|
25
|
-
`blur` (motion-blur sub-frames in captures and exports, 4 default for both `motion-loop` and
|
|
26
|
-
`LoopCanvas`, 8 for fast loops, 1 for none; the live preview always draws 1). An unknown `loop` id
|
|
27
|
-
warns in the console and falls back to `gradient-blobs`.
|
|
28
|
-
|
|
29
|
-
## The library
|
|
30
|
-
|
|
31
|
-
Backgrounds: `perspective-grid` (grid floor streaming to a glowing horizon: tech, retro, gaming),
|
|
32
|
-
`dot-wave` (dots swelling in a diagonal wave: calm product), `flow-lines` (breathing signal lines: data,
|
|
33
|
-
finance), `gradient-blobs` (living mesh gradient: the safe premium backdrop), `stripes-scroll` (bold
|
|
34
|
-
diagonal stripes: loud promos, sport, sales), `concentric-pulse` (rings on the beat: reveals, music),
|
|
35
|
-
`checker-twist` (tiles twisting in a wave: playful, design), `halftone-sweep` (halftone with light
|
|
36
|
-
bands: editorial, print), `terrain-ridges` (ridgelines rolling in: moody, music, night), `starfield-warp`
|
|
37
|
-
(warp streaks: hype, speed), `bokeh-drift` (soft rising lights: dreamy, lifestyle, behind devices),
|
|
38
|
-
`iso-cubes` (isometric blocks rising: infrastructure, dev tools), `ribbon-weave` (thick waving
|
|
39
|
-
ribbons: fluid, consumer), `tile-mosaic` (tiles flipping colour: marketplaces, many features).
|
|
40
|
-
|
|
41
|
-
Symmetry: `kaleidoscope` (8-way mirrored drift: music, festivals, hypnotic), `mandala-bloom` (petal rings
|
|
42
|
-
turning both ways: wellness, elegant), `spirograph` (a pen tracing a spirograph: precision, design),
|
|
43
|
-
`mirror-tiles` (four-way mirrored arc tiles turning: design, architecture), `radial-burst` (retro sunburst:
|
|
44
|
-
announcements, sales, pop).
|
|
45
|
-
|
|
46
|
-
Morphing: `shape-morph` (circle → square → triangle → star with squash: transformation, versatility),
|
|
47
|
-
`morph-grid` (a grid of shapes morphing in a wave: systems, modular), `shape-shuffle` (three shapes
|
|
48
|
-
hopping and becoming each other: choices, onboarding), `metaballs` (liquid blobs merging: fluid, AI).
|
|
49
|
-
|
|
50
|
-
Games: `snake-game` (pixel snake eating food: gaming, retro, 'level up'), `falling-blocks` (blocks stack and
|
|
51
|
-
clear: building, organizing), `pong` (paddles rallying: back-and-forth, versus), `life-gliders`
|
|
52
|
-
(Game of Life gliders: code, dev tools, emergence).
|
|
53
|
-
|
|
54
|
-
Physics: `newtons-cradle` (momentum, cause and effect), `clock-gears` (automation, workflows),
|
|
55
|
-
`liquid-fill` (progress, growth, drinks), `domino-wave` (chain reactions, automation).
|
|
56
|
-
|
|
57
|
-
Generative: `vortex` (particles spiralling into a core: AI, gravity), `lissajous-trail` (a comet tracing
|
|
58
|
-
a Lissajous figure: signals, elegance), `bubble-pop` (bubbles rising and popping: playful, social).
|
|
59
|
-
|
|
60
|
-
Shapes (one centered subject, use `transparent` over other layers): `orbit-rings` (AI, platforms),
|
|
61
|
-
`morph-blob` (assistants, organic), `bouncing-ball` (playful, loading), `spinner-petals` (blooming,
|
|
62
|
-
wellness), `stacked-squares` (layers, structure), `ripple-drop` (impact, calm), `cube-spin`
|
|
63
|
-
(products, blocks), `dna-helix` (science, health, data), `pie-burst` (analytics, sharing),
|
|
64
|
-
`wave-bars` (audio, voice, podcasts).
|
|
65
|
-
|
|
66
|
-
## "Generated by an agent" effects
|
|
67
|
-
|
|
68
|
-
- `dot-trace-title` (component): a headline traced in dots by a scan line that resolves into the type.
|
|
69
|
-
For AI features, agents, "built for you" moments. Lines take `*starred*` words or a `*starred phrase*`
|
|
70
|
-
for the accent; `size` is a share of the frame's short side (× 0.9), `dot` is px at 1080p (scales).
|
|
71
|
-
- `GenerateReveal` (scenes, from `agentcut/components`): a screenshot or photo builds itself the way an
|
|
72
|
-
agent would generate it: dotted wireframes per UI block (with the agent's cursor), a dotted fill made of
|
|
73
|
-
the image's own pixels, then the real pixels resolve block by block, with an optional agent log. When
|
|
74
|
-
the build ends (`from + duration`) the whole image cross-fades in over ~10 frames, so the end state is
|
|
75
|
-
exactly the screenshot, including areas no box covers.
|
|
76
|
-
`<GenerateReveal src={asset("assets/app.png")} width={1440} height={900} from={0} duration={120}
|
|
77
|
-
boxes={[[0,0,0.16,1],[0.18,0.1,0.79,0.08], …]} log={["Laying out the sidebar", …]} accent={brand} />`
|
|
78
|
-
- `width`/`height`: the box in px; the image covers it (crop like `object-fit: cover`). Inside a
|
|
79
|
-
cinematic `Screen` (as its children) the Screen's `width` and `aspect` define the box: pass
|
|
80
|
-
`width={W} height={W / aspect}` with the same values, or the build won't fill the screen.
|
|
81
|
-
- `boxes`: the UI's blocks `[x, y, w, h]` as fractions of the image in build order; measure them from
|
|
82
|
-
the image like hero regions (values are clamped to 0–1). Leave out for photos (one block).
|
|
83
|
-
- `mode`: `"ui"` (wireframe → dots → pixels) or `"image"` (tone sketch → colour dots → photo).
|
|
84
|
-
- `dot` (pitch in box px, default 9), `accent`, `log` (one line per block reads best; Geist Mono, loaded
|
|
85
|
-
and held for you), `logPosition`, `radius`, `background`.
|
|
86
|
-
- `resolution`: pixel ratio of the dots canvas, default 2 in renders/exports (sharp under a camera
|
|
87
|
-
push-in) and 1 in the live preview; lower it for very large boxes. A Plane's blurred and reflected
|
|
88
|
-
copies draw it at 0.5 automatically.
|
|
89
|
-
- The dotted fill reads the image's pixels, so it needs a same-origin asset (`asset(…)`) or a CORS-enabled
|
|
90
|
-
URL. Otherwise it logs a warning and builds without the dotted fill (wireframes, log and pixel reveal
|
|
91
|
-
still play); it never stops the export. A missing image still fails the render (its `<Img>`).
|
|
92
|
-
Use it once per video, as the hook or the "watch it build" moment.
|
|
93
|
-
|
|
94
|
-
## Brand palette first
|
|
95
|
-
|
|
96
|
-
1. Find the brand colours before you design: the logo, the product UI in the screenshots, the
|
|
97
|
-
website, `project.json`. Write them in notes.md: primary, secondary, and the brand's own dark and
|
|
98
|
-
light (often in the UI).
|
|
99
|
-
2. Build every look from them: `accent` = primary, `accent2` = secondary (or a complement: the primary's
|
|
100
|
-
opposite hue at lower saturation), tone per shot. Text on the loop: ink on `light`, paper on `dark`,
|
|
101
|
-
whichever reads on `accent`.
|
|
102
|
-
3. Two or three colours per frame, never a rainbow. One accent moment per shot.
|
|
103
|
-
|
|
104
|
-
## Variety (every video, every take)
|
|
105
|
-
|
|
106
|
-
- Never the same loop twice in a row, and at least three different loops or looks in a 15–30 s video.
|
|
107
|
-
- Alternate tones between shots (dark → light → accent …) or hold one tone and vary the loop: decide,
|
|
108
|
-
then write the rotation in the shot list.
|
|
109
|
-
- Change `seed` when you reuse a loop, and pick loops by mood (the list above), not by habit: before
|
|
110
|
-
you choose, write the two you used in the last video in notes.md (if any) and pick others.
|
|
111
|
-
- Mix layers: a background loop, the hero (screens, devices, type), and sometimes a shape loop as an
|
|
112
|
-
accent (transparent, small, in a corner or behind a title) or kinetic shapes on a Plane in depth.
|
|
113
|
-
- Shape loops are great section openers and end cards: a centered shape with the brand name below it.
|
|
114
|
-
|
|
115
|
-
## Write a new loop (when nothing fits)
|
|
116
|
-
|
|
117
|
-
Write it in the scene as a draw function and pass it to `LoopCanvas`:
|
|
118
|
-
|
|
119
|
-
```tsx
|
|
120
|
-
import { LoopCanvas, type LoopDraw } from "agentcut/components";
|
|
121
|
-
const sparks: LoopDraw = (ctx, w, h, t, P, M, seed) => {
|
|
122
|
-
const u = h / 100;
|
|
123
|
-
for (let i = 0; i < 60; i++) {
|
|
124
|
-
const p = M.phase(t, 3, M.rand(i, seed)); // a 3 s cycle, staggered per element
|
|
125
|
-
ctx.fillStyle = M.rgba(i % 4 ? P.fg : P.fg2, 1 - p);
|
|
126
|
-
ctx.beginPath();
|
|
127
|
-
ctx.arc(M.rand(i, 1) * w, h - p * h, u * (0.5 + 2 * M.rand(i, 2)), 0, M.TAU);
|
|
128
|
-
ctx.fill();
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
// <LoopCanvas loop={sparks} accent={brand} tone="dark" />
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Rules that keep it seamless and premium:
|
|
135
|
-
- The frame depends on `t` only: no `Math.random`, `Date` or state between frames; randomness from
|
|
136
|
-
`M.rand(i, salt)`. Every period divides 12 (1, 1.5, 2, 3, 4, 6, 12) via `M.phase(t, period, offset)`;
|
|
137
|
-
scrolls move whole pattern repeats per period; anything indexed by cycle wraps with `M.mod`.
|
|
138
|
-
- Colours only from `P` (`bg fg fg2 mid accent accent2 paper ink`) with `M.rgba` / `M.mixColor`.
|
|
139
|
-
- Sizes from `u = h / 100` (shapes: `Math.min(w, h) / 100`), counts from `w`, so it works in wide and
|
|
140
|
-
mobile.
|
|
141
|
-
- Designed motion: eases from `M.ease` (`outBack`, `spring`, `inOutCubic`…), anticipation and
|
|
142
|
-
overshoot, short holds; constant speed only for scrolls and streams. `M.win(p, a, b)` chains
|
|
143
|
-
wind-up, action and settle inside a cycle; put the loop point inside a hold.
|
|
144
|
-
- Keep a frame under ~2,000 primitives; glows are radial gradients, never `ctx.filter`.
|
|
145
|
-
- Check it: capture frames inside one cycle and either side of the 12 s point.
|
|
146
|
-
|
|
147
|
-
A loop worth keeping for other videos: save it in the workspace library
|
|
148
|
-
(`library/loops/<name>.ts`, exporting the draw function) with a one-line description at the top, and
|
|
149
|
-
list it in `library/loops/README.md`. Later videos import it by relative path from their scene:
|
|
150
|
-
`import { sparks } from "../../../library/loops/sparks";` (scenes live in `projects/<slug>/scenes/`).
|
|
151
|
-
Read `library/loops/README.md` before writing a new loop: one may already exist.
|
|
1
|
+
# Motion loops, brand palettes and variety
|
|
2
|
+
|
|
3
|
+
Agentcut ships a library of 44 seamless **motion loops** (all live at agentcut.synteq.app/loops),
|
|
4
|
+
each a pure function of time on a 12 s cycle (the frame at 12 s is the frame at 0 s), drawn from the
|
|
5
|
+
brand's colours. Use them so no video sits on a dead flat colour, and so every video looks different.
|
|
6
|
+
|
|
7
|
+
## Use one
|
|
8
|
+
|
|
9
|
+
- **As a clip** (the user can edit it in the inspector): component `motion-loop` on a track under the
|
|
10
|
+
content, e.g. `{ "component": "motion-loop", "props": { "loop": "dot-wave", "tone": "light",
|
|
11
|
+
"accent": "#f97316", "accent2": "#ec4899", "seed": 7 } }`. `agentcut_components` with
|
|
12
|
+
`id: "motion-loop"` lists every loop.
|
|
13
|
+
- **Inside a scene** (behind a cinematic Stage, on a card, in a split):
|
|
14
|
+
`import { LoopCanvas } from "agentcut/components"` →
|
|
15
|
+
`<LoopCanvas loop="iso-cubes" accent={brand} accent2={brand2} tone="dark" seed={3} />`. Without
|
|
16
|
+
`width`/`height` it is frame-sized and stretches to its parent, so use it full-frame (or in a box
|
|
17
|
+
with the frame's aspect). In any other box pass that box's size in px, e.g. on a `Plane` (a great
|
|
18
|
+
card in 3D): `<Plane width={800} height={500}><LoopCanvas loop="dot-wave" width={800} height={500} /></Plane>`;
|
|
19
|
+
then it draws at exactly that size and never distorts. Put it first inside `<Stage>` instead of
|
|
20
|
+
`<Backdrop>`, or on a Plane far behind the devices (`z: -800`) so it parallaxes with the camera.
|
|
21
|
+
- Props: `tone` `dark` (deep brand-tinted background, brand motif), `accent` (solid brand colour,
|
|
22
|
+
ink or paper motif), `light` (paper background, ink motif, brand as the second colour); `speed`
|
|
23
|
+
(seamless at any speed inside a clip; a clip that repeats needs length × speed to be a multiple of
|
|
24
|
+
12 s); `seed` (another layout of the same loop); `transparent` (shapes over footage or a Stage);
|
|
25
|
+
`blur` (motion-blur sub-frames in captures and exports, 4 default for both `motion-loop` and
|
|
26
|
+
`LoopCanvas`, 8 for fast loops, 1 for none; the live preview always draws 1). An unknown `loop` id
|
|
27
|
+
warns in the console and falls back to `gradient-blobs`.
|
|
28
|
+
|
|
29
|
+
## The library
|
|
30
|
+
|
|
31
|
+
Backgrounds: `perspective-grid` (grid floor streaming to a glowing horizon: tech, retro, gaming),
|
|
32
|
+
`dot-wave` (dots swelling in a diagonal wave: calm product), `flow-lines` (breathing signal lines: data,
|
|
33
|
+
finance), `gradient-blobs` (living mesh gradient: the safe premium backdrop), `stripes-scroll` (bold
|
|
34
|
+
diagonal stripes: loud promos, sport, sales), `concentric-pulse` (rings on the beat: reveals, music),
|
|
35
|
+
`checker-twist` (tiles twisting in a wave: playful, design), `halftone-sweep` (halftone with light
|
|
36
|
+
bands: editorial, print), `terrain-ridges` (ridgelines rolling in: moody, music, night), `starfield-warp`
|
|
37
|
+
(warp streaks: hype, speed), `bokeh-drift` (soft rising lights: dreamy, lifestyle, behind devices),
|
|
38
|
+
`iso-cubes` (isometric blocks rising: infrastructure, dev tools), `ribbon-weave` (thick waving
|
|
39
|
+
ribbons: fluid, consumer), `tile-mosaic` (tiles flipping colour: marketplaces, many features).
|
|
40
|
+
|
|
41
|
+
Symmetry: `kaleidoscope` (8-way mirrored drift: music, festivals, hypnotic), `mandala-bloom` (petal rings
|
|
42
|
+
turning both ways: wellness, elegant), `spirograph` (a pen tracing a spirograph: precision, design),
|
|
43
|
+
`mirror-tiles` (four-way mirrored arc tiles turning: design, architecture), `radial-burst` (retro sunburst:
|
|
44
|
+
announcements, sales, pop).
|
|
45
|
+
|
|
46
|
+
Morphing: `shape-morph` (circle → square → triangle → star with squash: transformation, versatility),
|
|
47
|
+
`morph-grid` (a grid of shapes morphing in a wave: systems, modular), `shape-shuffle` (three shapes
|
|
48
|
+
hopping and becoming each other: choices, onboarding), `metaballs` (liquid blobs merging: fluid, AI).
|
|
49
|
+
|
|
50
|
+
Games: `snake-game` (pixel snake eating food: gaming, retro, 'level up'), `falling-blocks` (blocks stack and
|
|
51
|
+
clear: building, organizing), `pong` (paddles rallying: back-and-forth, versus), `life-gliders`
|
|
52
|
+
(Game of Life gliders: code, dev tools, emergence).
|
|
53
|
+
|
|
54
|
+
Physics: `newtons-cradle` (momentum, cause and effect), `clock-gears` (automation, workflows),
|
|
55
|
+
`liquid-fill` (progress, growth, drinks), `domino-wave` (chain reactions, automation).
|
|
56
|
+
|
|
57
|
+
Generative: `vortex` (particles spiralling into a core: AI, gravity), `lissajous-trail` (a comet tracing
|
|
58
|
+
a Lissajous figure: signals, elegance), `bubble-pop` (bubbles rising and popping: playful, social).
|
|
59
|
+
|
|
60
|
+
Shapes (one centered subject, use `transparent` over other layers): `orbit-rings` (AI, platforms),
|
|
61
|
+
`morph-blob` (assistants, organic), `bouncing-ball` (playful, loading), `spinner-petals` (blooming,
|
|
62
|
+
wellness), `stacked-squares` (layers, structure), `ripple-drop` (impact, calm), `cube-spin`
|
|
63
|
+
(products, blocks), `dna-helix` (science, health, data), `pie-burst` (analytics, sharing),
|
|
64
|
+
`wave-bars` (audio, voice, podcasts).
|
|
65
|
+
|
|
66
|
+
## "Generated by an agent" effects
|
|
67
|
+
|
|
68
|
+
- `dot-trace-title` (component): a headline traced in dots by a scan line that resolves into the type.
|
|
69
|
+
For AI features, agents, "built for you" moments. Lines take `*starred*` words or a `*starred phrase*`
|
|
70
|
+
for the accent; `size` is a share of the frame's short side (× 0.9), `dot` is px at 1080p (scales).
|
|
71
|
+
- `GenerateReveal` (scenes, from `agentcut/components`): a screenshot or photo builds itself the way an
|
|
72
|
+
agent would generate it: dotted wireframes per UI block (with the agent's cursor), a dotted fill made of
|
|
73
|
+
the image's own pixels, then the real pixels resolve block by block, with an optional agent log. When
|
|
74
|
+
the build ends (`from + duration`) the whole image cross-fades in over ~10 frames, so the end state is
|
|
75
|
+
exactly the screenshot, including areas no box covers.
|
|
76
|
+
`<GenerateReveal src={asset("assets/app.png")} width={1440} height={900} from={0} duration={120}
|
|
77
|
+
boxes={[[0,0,0.16,1],[0.18,0.1,0.79,0.08], …]} log={["Laying out the sidebar", …]} accent={brand} />`
|
|
78
|
+
- `width`/`height`: the box in px; the image covers it (crop like `object-fit: cover`). Inside a
|
|
79
|
+
cinematic `Screen` (as its children) the Screen's `width` and `aspect` define the box: pass
|
|
80
|
+
`width={W} height={W / aspect}` with the same values, or the build won't fill the screen.
|
|
81
|
+
- `boxes`: the UI's blocks `[x, y, w, h]` as fractions of the image in build order; measure them from
|
|
82
|
+
the image like hero regions (values are clamped to 0–1). Leave out for photos (one block).
|
|
83
|
+
- `mode`: `"ui"` (wireframe → dots → pixels) or `"image"` (tone sketch → colour dots → photo).
|
|
84
|
+
- `dot` (pitch in box px, default 9), `accent`, `log` (one line per block reads best; Geist Mono, loaded
|
|
85
|
+
and held for you), `logPosition`, `radius`, `background`.
|
|
86
|
+
- `resolution`: pixel ratio of the dots canvas, default 2 in renders/exports (sharp under a camera
|
|
87
|
+
push-in) and 1 in the live preview; lower it for very large boxes. A Plane's blurred and reflected
|
|
88
|
+
copies draw it at 0.5 automatically.
|
|
89
|
+
- The dotted fill reads the image's pixels, so it needs a same-origin asset (`asset(…)`) or a CORS-enabled
|
|
90
|
+
URL. Otherwise it logs a warning and builds without the dotted fill (wireframes, log and pixel reveal
|
|
91
|
+
still play); it never stops the export. A missing image still fails the render (its `<Img>`).
|
|
92
|
+
Use it once per video, as the hook or the "watch it build" moment.
|
|
93
|
+
|
|
94
|
+
## Brand palette first
|
|
95
|
+
|
|
96
|
+
1. Find the brand colours before you design: the logo, the product UI in the screenshots, the
|
|
97
|
+
website, `project.json`. Write them in notes.md: primary, secondary, and the brand's own dark and
|
|
98
|
+
light (often in the UI).
|
|
99
|
+
2. Build every look from them: `accent` = primary, `accent2` = secondary (or a complement: the primary's
|
|
100
|
+
opposite hue at lower saturation), tone per shot. Text on the loop: ink on `light`, paper on `dark`,
|
|
101
|
+
whichever reads on `accent`.
|
|
102
|
+
3. Two or three colours per frame, never a rainbow. One accent moment per shot.
|
|
103
|
+
|
|
104
|
+
## Variety (every video, every take)
|
|
105
|
+
|
|
106
|
+
- Never the same loop twice in a row, and at least three different loops or looks in a 15–30 s video.
|
|
107
|
+
- Alternate tones between shots (dark → light → accent …) or hold one tone and vary the loop: decide,
|
|
108
|
+
then write the rotation in the shot list.
|
|
109
|
+
- Change `seed` when you reuse a loop, and pick loops by mood (the list above), not by habit: before
|
|
110
|
+
you choose, write the two you used in the last video in notes.md (if any) and pick others.
|
|
111
|
+
- Mix layers: a background loop, the hero (screens, devices, type), and sometimes a shape loop as an
|
|
112
|
+
accent (transparent, small, in a corner or behind a title) or kinetic shapes on a Plane in depth.
|
|
113
|
+
- Shape loops are great section openers and end cards: a centered shape with the brand name below it.
|
|
114
|
+
|
|
115
|
+
## Write a new loop (when nothing fits)
|
|
116
|
+
|
|
117
|
+
Write it in the scene as a draw function and pass it to `LoopCanvas`:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import { LoopCanvas, type LoopDraw } from "agentcut/components";
|
|
121
|
+
const sparks: LoopDraw = (ctx, w, h, t, P, M, seed) => {
|
|
122
|
+
const u = h / 100;
|
|
123
|
+
for (let i = 0; i < 60; i++) {
|
|
124
|
+
const p = M.phase(t, 3, M.rand(i, seed)); // a 3 s cycle, staggered per element
|
|
125
|
+
ctx.fillStyle = M.rgba(i % 4 ? P.fg : P.fg2, 1 - p);
|
|
126
|
+
ctx.beginPath();
|
|
127
|
+
ctx.arc(M.rand(i, 1) * w, h - p * h, u * (0.5 + 2 * M.rand(i, 2)), 0, M.TAU);
|
|
128
|
+
ctx.fill();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// <LoopCanvas loop={sparks} accent={brand} tone="dark" />
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Rules that keep it seamless and premium:
|
|
135
|
+
- The frame depends on `t` only: no `Math.random`, `Date` or state between frames; randomness from
|
|
136
|
+
`M.rand(i, salt)`. Every period divides 12 (1, 1.5, 2, 3, 4, 6, 12) via `M.phase(t, period, offset)`;
|
|
137
|
+
scrolls move whole pattern repeats per period; anything indexed by cycle wraps with `M.mod`.
|
|
138
|
+
- Colours only from `P` (`bg fg fg2 mid accent accent2 paper ink`) with `M.rgba` / `M.mixColor`.
|
|
139
|
+
- Sizes from `u = h / 100` (shapes: `Math.min(w, h) / 100`), counts from `w`, so it works in wide and
|
|
140
|
+
mobile.
|
|
141
|
+
- Designed motion: eases from `M.ease` (`outBack`, `spring`, `inOutCubic`…), anticipation and
|
|
142
|
+
overshoot, short holds; constant speed only for scrolls and streams. `M.win(p, a, b)` chains
|
|
143
|
+
wind-up, action and settle inside a cycle; put the loop point inside a hold.
|
|
144
|
+
- Keep a frame under ~2,000 primitives; glows are radial gradients, never `ctx.filter`.
|
|
145
|
+
- Check it: capture frames inside one cycle and either side of the 12 s point.
|
|
146
|
+
|
|
147
|
+
A loop worth keeping for other videos: save it in the workspace library
|
|
148
|
+
(`library/loops/<name>.ts`, exporting the draw function) with a one-line description at the top, and
|
|
149
|
+
list it in `library/loops/README.md`. Later videos import it by relative path from their scene:
|
|
150
|
+
`import { sparks } from "../../../library/loops/sparks";` (scenes live in `projects/<slug>/scenes/`).
|
|
151
|
+
Read `library/loops/README.md` before writing a new loop: one may already exist.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Working through MCP from outside the workspace
|
|
2
|
+
|
|
3
|
+
Use the same creative and review workflow whether you work inside Agentcut or through MCP.
|
|
4
|
+
Start with `agentcut_capabilities`, `SKILL.md` through `agentcut_guide`, then `agentcut_status`.
|
|
5
|
+
Supporting `references/*.md` files are available through `agentcut_guide` and MCP guide resources.
|
|
6
|
+
If you cannot read the helper's local disk, use `agentcut_list_files`, `agentcut_read_file`,
|
|
7
|
+
`agentcut_write_file` and `agentcut_copy_file`. These operate on the connected helper's workspace,
|
|
8
|
+
not your own current folder. Read before writing and pass the returned hash to preserve hand edits.
|
|
9
|
+
Use `baseHash: null` only for a new file. Call status after scene or timeline edits to check the build.
|
|
10
|
+
|
|
11
|
+
File scopes are `project`, `library` and read-only `toolkit`. Workspace `library/presets/...` is
|
|
12
|
+
scope `library`, path `presets/...`; `.agentcut/components/...` is scope `toolkit`, path
|
|
13
|
+
`components/...`; `.agentcut/runtime/...` is scope `toolkit`, path `runtime/...`. List preset files,
|
|
14
|
+
read their recipes and copy their scenes/assets into the project. Music, SFX and b-roll catalogs
|
|
15
|
+
use their existing search/add tools. Capture and contact-sheet calls return MCP images as well
|
|
16
|
+
as local paths, so visual review does not require a shared disk. Keep all creative and review steps.
|
|
17
|
+
For local app code, call `agentcut_sources`. Scope `source` reads only folders already allowed
|
|
18
|
+
with the helper's `--add-dir` option; pass the returned ID as `source` for list/read, or
|
|
19
|
+
`sourceRoot` for copy. Source folders stay read-only. MCP cannot grant itself new folder access.
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
# Preview performance
|
|
2
|
-
|
|
3
|
-
The user watches the live preview, which draws every scene in their browser at playback speed. A scene
|
|
4
|
-
that takes too long per frame makes the preview skip frames (choppy) and can freeze the tab while you
|
|
5
|
-
capture frames. The export doesn't skip: it renders every frame at full quality. So:
|
|
6
|
-
|
|
7
|
-
**Never lower what the render shows to make the preview smoother.** No lower resolution, fewer
|
|
8
|
-
elements on screen, skipped frames, softer images or simpler motion. Every change below must render
|
|
9
|
-
the same frames as before (check with captures); when one can't, keep the look and tell the user that
|
|
10
|
-
part previews choppy but exports perfectly.
|
|
11
|
-
|
|
12
|
-
## Measure
|
|
13
|
-
|
|
14
|
-
For website how-to videos, use the stall recovery in `website-howto.md`. Keep all required
|
|
15
|
-
format, visual, playback and audio checks. Run page-heavy tools in sequence. A timed-out request
|
|
16
|
-
can continue in the page; inspect `page.activeWork` before retrying. A small recovery probe does
|
|
17
|
-
not replace the full review or reduce final render quality.
|
|
18
|
-
|
|
19
|
-
- `agentcut_preview_check` (from/to in frames) plays a range muted in the user's preview and returns
|
|
20
|
-
per visual clip: frames played and dropped, loading stalls, the longest freeze, the most DOM elements
|
|
21
|
-
the clip drew, and a verdict: `smooth`, `choppy` from 20 % dropped, `heavy` from 40 % (and at least 6
|
|
22
|
-
dropped frames); a freeze over a second or more than 0.5 s of stalls also counts as slow. It takes as
|
|
23
|
-
long as the range plays: check the clip you changed, not the whole video every time. One check at a
|
|
24
|
-
time; it stops if the user pauses or seeks.
|
|
25
|
-
- `slowClips` lists the likeliest cause first. `sharesDropsOnly` marks a clip (often text or captions)
|
|
26
|
-
that only sits on top of a slower one: fix the other one. `slowToMount` means the clip drops frames in
|
|
27
|
-
the second before it starts, while it mounts early: its setup work is heavy (see rule 4), even when it
|
|
28
|
-
plays fine afterwards.
|
|
29
|
-
- `agentcut_status` → `page.previewPerformance` has the latest check (`lastCheck`), the user's own
|
|
30
|
-
playback (`playback`) and seek timings (`scrub`). `current: false` means it was measured on an older build.
|
|
31
|
-
- A check also returns `scrub`: how long a seek takes to reach the screen (`medianMs`, `p95Ms`, `slowClips`),
|
|
32
|
-
jumping forward and back through the range. A scene can play well and still lag on a drag, because every
|
|
33
|
-
seek draws it from nothing. Above 120 ms a drag visibly lags: the same fixes below apply, and work a scene
|
|
34
|
-
repeats on every frame (not just at mount) is the usual cause.
|
|
35
|
-
- Footage needs nothing from you: the helper makes fast-seeking copies for the preview by itself, and
|
|
36
|
-
captures and exports always read the original. Only `src` on a video clip gets one, so use a video clip
|
|
37
|
-
rather than a video inside a scene when footage is slow to scrub.
|
|
38
|
-
- Run a check after building or changing a heavy scene (walls and grids, hundreds of elements, image
|
|
39
|
-
sequences, big blurs, generated images) and before you say you're done. A first run includes loading
|
|
40
|
-
(stalls); run it again to see steady playback. A machine's own jitter varies between runs: act on a
|
|
41
|
-
`choppy` only when a second run agrees.
|
|
42
|
-
|
|
43
|
-
## Make it lighter (same pixels)
|
|
44
|
-
|
|
45
|
-
1. **Image sequences that stall.** Swapping a different picture every few frames makes the browser fetch
|
|
46
|
-
and decode a full image each time. When a check shows stalls or drops on one, encode it into one video,
|
|
47
|
-
but only if it keeps the same picture and timing:
|
|
48
|
-
- Keep the images when the frames have transparency (H.264 has none, they'd render on black), or
|
|
49
|
-
small text and hard-edged colored UI (4:2:0 color softens it).
|
|
50
|
-
- The video must show each image on exactly the frames it shows now. Images held the same number of
|
|
51
|
-
frames each: `-framerate <fps / frames per image>`. Any other timing (eased, held, reversed): write
|
|
52
|
-
the images out in display order, one file per project frame, and encode at the project fps.
|
|
53
|
-
- Encode at the frames' own size (never smaller than they ever appear), visually lossless, BT.709:
|
|
54
|
-
```
|
|
55
|
-
ffmpeg -framerate <rate> -start_number <first> -i f%03d.png \
|
|
56
|
-
-vf "pad=ceil(iw/2)*2:ceil(ih/2)*2,scale=out_color_matrix=bt709:out_range=tv,format=yuv420p" \
|
|
57
|
-
-c:v libx264 -crf 12 -preset slow -colorspace bt709 -color_primaries bt709 -color_trc bt709 \
|
|
58
|
-
-color_range tv -movflags +faststart out.mp4
|
|
59
|
-
```
|
|
60
|
-
`pad` adds one pixel on the right or bottom when a side is odd (H.264 4:2:0 needs even sizes):
|
|
61
|
-
draw the video at its padded size inside a box of the frames' size with `overflow: hidden`.
|
|
62
|
-
- ffmpeg is on PATH or in `~/.agentcut/tools/ffmpeg/`; if there's none, ask the user.
|
|
63
|
-
- Play it with `<Video>` from `@remotion/media` (`trimBefore` in frames to start inside it). Many tiles
|
|
64
|
-
of the same footage: one video per distinct clip.
|
|
65
|
-
- Capture frames across the sequence before and after and compare; if colors or edges differ,
|
|
66
|
-
keep the images.
|
|
67
|
-
2. **Repeated complex elements that never change** (a wall of the same static card): draw the piece
|
|
68
|
-
once to an image and show the copies as `<Img>`. Make it with `agentcut_capture_frames` at `scale: 2`
|
|
69
|
-
with `region` set to the piece's box in composition pixels, on a frame where it's fully drawn and
|
|
70
|
-
unobstructed; save it in `assets/` and show it at its 1x size. Keep the live version for every copy
|
|
71
|
-
that animates or changes, and for anything the camera zooms past 2x, so its text stays sharp (House
|
|
72
|
-
style).
|
|
73
|
-
3. **Draw only what's visible.** An absolutely positioned element that is fully outside the frame or at
|
|
74
|
-
opacity 0 can `return null`. Not when it sits in a flex or grid layout (opacity 0 still takes its
|
|
75
|
-
space, so its siblings would move), not when it holds `<Audio>`/`<Video>` (the sound would stop), and
|
|
76
|
-
"outside" means after the camera's transforms and including its shadow and blur.
|
|
77
|
-
4. **Compute once.** Canvases, data URLs, noise and layout math that don't depend on the frame go in
|
|
78
|
-
`useMemo` (or module scope), never in every render; nothing heavy in a component that mounts per tile.
|
|
79
|
-
Anything random must stay deterministic: `random("seed")` from `remotion`, never `Math.random()`,
|
|
80
|
-
which differs on every load and between the export's render tabs (it would flicker).
|
|
81
|
-
5. **One filter on a wrapper** instead of the same `filter`/`blur` on dozens of children, only when the
|
|
82
|
-
children don't overlap or touch (a blur or drop-shadow of the group differs where they meet), then
|
|
83
|
-
compare captures. Big animated blurs are the most expensive thing to draw: keep their area as small as
|
|
84
|
-
the look allows.
|
|
85
|
-
6. **Fewer DOM nodes for the same look.** A stack of plain divs for a skeleton UI can often be one
|
|
86
|
-
element with a `linear-gradient` background or an inline SVG that draws the same lines (check
|
|
87
|
-
`browser-export.md` for what the export draws). Never remove anything that shows.
|
|
88
|
-
7. **WebGL and canvas scenes**: `usePreviewQuality()` lowers resolution and redraw rate in the preview
|
|
89
|
-
only (`browser-export.md`); captures and the export keep full quality.
|
|
90
|
-
|
|
91
|
-
After a change, capture the same frames as before (`agentcut_capture_frames`, the export's own
|
|
92
|
-
renderer) and compare: the frames must look the same. Then run `agentcut_preview_check` again and report
|
|
93
|
-
the before/after drop rates.
|
|
1
|
+
# Preview performance
|
|
2
|
+
|
|
3
|
+
The user watches the live preview, which draws every scene in their browser at playback speed. A scene
|
|
4
|
+
that takes too long per frame makes the preview skip frames (choppy) and can freeze the tab while you
|
|
5
|
+
capture frames. The export doesn't skip: it renders every frame at full quality. So:
|
|
6
|
+
|
|
7
|
+
**Never lower what the render shows to make the preview smoother.** No lower resolution, fewer
|
|
8
|
+
elements on screen, skipped frames, softer images or simpler motion. Every change below must render
|
|
9
|
+
the same frames as before (check with captures); when one can't, keep the look and tell the user that
|
|
10
|
+
part previews choppy but exports perfectly.
|
|
11
|
+
|
|
12
|
+
## Measure
|
|
13
|
+
|
|
14
|
+
For website how-to videos, use the stall recovery in `website-howto.md`. Keep all required
|
|
15
|
+
format, visual, playback and audio checks. Run page-heavy tools in sequence. A timed-out request
|
|
16
|
+
can continue in the page; inspect `page.activeWork` before retrying. A small recovery probe does
|
|
17
|
+
not replace the full review or reduce final render quality.
|
|
18
|
+
|
|
19
|
+
- `agentcut_preview_check` (from/to in frames) plays a range muted in the user's preview and returns
|
|
20
|
+
per visual clip: frames played and dropped, loading stalls, the longest freeze, the most DOM elements
|
|
21
|
+
the clip drew, and a verdict: `smooth`, `choppy` from 20 % dropped, `heavy` from 40 % (and at least 6
|
|
22
|
+
dropped frames); a freeze over a second or more than 0.5 s of stalls also counts as slow. It takes as
|
|
23
|
+
long as the range plays: check the clip you changed, not the whole video every time. One check at a
|
|
24
|
+
time; it stops if the user pauses or seeks.
|
|
25
|
+
- `slowClips` lists the likeliest cause first. `sharesDropsOnly` marks a clip (often text or captions)
|
|
26
|
+
that only sits on top of a slower one: fix the other one. `slowToMount` means the clip drops frames in
|
|
27
|
+
the second before it starts, while it mounts early: its setup work is heavy (see rule 4), even when it
|
|
28
|
+
plays fine afterwards.
|
|
29
|
+
- `agentcut_status` → `page.previewPerformance` has the latest check (`lastCheck`), the user's own
|
|
30
|
+
playback (`playback`) and seek timings (`scrub`). `current: false` means it was measured on an older build.
|
|
31
|
+
- A check also returns `scrub`: how long a seek takes to reach the screen (`medianMs`, `p95Ms`, `slowClips`),
|
|
32
|
+
jumping forward and back through the range. A scene can play well and still lag on a drag, because every
|
|
33
|
+
seek draws it from nothing. Above 120 ms a drag visibly lags: the same fixes below apply, and work a scene
|
|
34
|
+
repeats on every frame (not just at mount) is the usual cause.
|
|
35
|
+
- Footage needs nothing from you: the helper makes fast-seeking copies for the preview by itself, and
|
|
36
|
+
captures and exports always read the original. Only `src` on a video clip gets one, so use a video clip
|
|
37
|
+
rather than a video inside a scene when footage is slow to scrub.
|
|
38
|
+
- Run a check after building or changing a heavy scene (walls and grids, hundreds of elements, image
|
|
39
|
+
sequences, big blurs, generated images) and before you say you're done. A first run includes loading
|
|
40
|
+
(stalls); run it again to see steady playback. A machine's own jitter varies between runs: act on a
|
|
41
|
+
`choppy` only when a second run agrees.
|
|
42
|
+
|
|
43
|
+
## Make it lighter (same pixels)
|
|
44
|
+
|
|
45
|
+
1. **Image sequences that stall.** Swapping a different picture every few frames makes the browser fetch
|
|
46
|
+
and decode a full image each time. When a check shows stalls or drops on one, encode it into one video,
|
|
47
|
+
but only if it keeps the same picture and timing:
|
|
48
|
+
- Keep the images when the frames have transparency (H.264 has none, they'd render on black), or
|
|
49
|
+
small text and hard-edged colored UI (4:2:0 color softens it).
|
|
50
|
+
- The video must show each image on exactly the frames it shows now. Images held the same number of
|
|
51
|
+
frames each: `-framerate <fps / frames per image>`. Any other timing (eased, held, reversed): write
|
|
52
|
+
the images out in display order, one file per project frame, and encode at the project fps.
|
|
53
|
+
- Encode at the frames' own size (never smaller than they ever appear), visually lossless, BT.709:
|
|
54
|
+
```
|
|
55
|
+
ffmpeg -framerate <rate> -start_number <first> -i f%03d.png \
|
|
56
|
+
-vf "pad=ceil(iw/2)*2:ceil(ih/2)*2,scale=out_color_matrix=bt709:out_range=tv,format=yuv420p" \
|
|
57
|
+
-c:v libx264 -crf 12 -preset slow -colorspace bt709 -color_primaries bt709 -color_trc bt709 \
|
|
58
|
+
-color_range tv -movflags +faststart out.mp4
|
|
59
|
+
```
|
|
60
|
+
`pad` adds one pixel on the right or bottom when a side is odd (H.264 4:2:0 needs even sizes):
|
|
61
|
+
draw the video at its padded size inside a box of the frames' size with `overflow: hidden`.
|
|
62
|
+
- ffmpeg is on PATH or in `~/.agentcut/tools/ffmpeg/`; if there's none, ask the user.
|
|
63
|
+
- Play it with `<Video>` from `@remotion/media` (`trimBefore` in frames to start inside it). Many tiles
|
|
64
|
+
of the same footage: one video per distinct clip.
|
|
65
|
+
- Capture frames across the sequence before and after and compare; if colors or edges differ,
|
|
66
|
+
keep the images.
|
|
67
|
+
2. **Repeated complex elements that never change** (a wall of the same static card): draw the piece
|
|
68
|
+
once to an image and show the copies as `<Img>`. Make it with `agentcut_capture_frames` at `scale: 2`
|
|
69
|
+
with `region` set to the piece's box in composition pixels, on a frame where it's fully drawn and
|
|
70
|
+
unobstructed; save it in `assets/` and show it at its 1x size. Keep the live version for every copy
|
|
71
|
+
that animates or changes, and for anything the camera zooms past 2x, so its text stays sharp (House
|
|
72
|
+
style).
|
|
73
|
+
3. **Draw only what's visible.** An absolutely positioned element that is fully outside the frame or at
|
|
74
|
+
opacity 0 can `return null`. Not when it sits in a flex or grid layout (opacity 0 still takes its
|
|
75
|
+
space, so its siblings would move), not when it holds `<Audio>`/`<Video>` (the sound would stop), and
|
|
76
|
+
"outside" means after the camera's transforms and including its shadow and blur.
|
|
77
|
+
4. **Compute once.** Canvases, data URLs, noise and layout math that don't depend on the frame go in
|
|
78
|
+
`useMemo` (or module scope), never in every render; nothing heavy in a component that mounts per tile.
|
|
79
|
+
Anything random must stay deterministic: `random("seed")` from `remotion`, never `Math.random()`,
|
|
80
|
+
which differs on every load and between the export's render tabs (it would flicker).
|
|
81
|
+
5. **One filter on a wrapper** instead of the same `filter`/`blur` on dozens of children, only when the
|
|
82
|
+
children don't overlap or touch (a blur or drop-shadow of the group differs where they meet), then
|
|
83
|
+
compare captures. Big animated blurs are the most expensive thing to draw: keep their area as small as
|
|
84
|
+
the look allows.
|
|
85
|
+
6. **Fewer DOM nodes for the same look.** A stack of plain divs for a skeleton UI can often be one
|
|
86
|
+
element with a `linear-gradient` background or an inline SVG that draws the same lines (check
|
|
87
|
+
`browser-export.md` for what the export draws). Never remove anything that shows.
|
|
88
|
+
7. **WebGL and canvas scenes**: `usePreviewQuality()` lowers resolution and redraw rate in the preview
|
|
89
|
+
only (`browser-export.md`); captures and the export keep full quality.
|
|
90
|
+
|
|
91
|
+
After a change, capture the same frames as before (`agentcut_capture_frames`, the export's own
|
|
92
|
+
renderer) and compare: the frames must look the same. Then run `agentcut_preview_check` again and report
|
|
93
|
+
the before/after drop rates.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# Graphics behind a person
|
|
2
|
-
|
|
3
|
-
Use agentcut_cutout_person when the user wants text or a graphic behind someone, or the person in front of something. Do not install segmentation packages, write background-removal scripts, export frames or use image APIs.
|
|
4
|
-
|
|
5
|
-
The stack, top to bottom: the person cutout, the graphic, the original footage. The footage stays in place, so a slightly loose edge only shows where the graphic touches the person.
|
|
6
|
-
|
|
7
|
-
1. Add the graphic on a track above the footage first, and note its clip ID and frames.
|
|
8
|
-
2. Call agentcut_cutout_person with the footage clipId, fromFrame and durationInFrames covering only the frames where the graphic is on screen, and behind with the graphic's clip ID. Cutting out only those frames is much faster than the whole clip. The first run also downloads a model of about 26 MB.
|
|
9
|
-
3. Check captures at the start, middle and end of the range, and where the graphic overlaps the person. Look at hair, hands and fast movement.
|
|
10
|
-
|
|
11
|
-
The tool adds a muted video clip to a track named Person cutout. Keep captions on a track above the cutout so the person doesn't cover them.
|
|
12
|
-
|
|
13
|
-
- To grade a person apart from their background, use `agentcut_grade_subject` instead (see `references/color.md`).
|
|
14
|
-
- It copies the footage clip's trim, speed, box, crop, fit and grade once. After changing those, or moving the footage, run the tool again with the same range; it replaces the earlier cutout on that range.
|
|
15
|
-
- A range can't start or end inside an enter or exit animation of the footage, and a project style camera needs the whole clip: the tool returns needs_full_clip, so omit the range.
|
|
16
|
-
- Works on the person in front; it can't choose between people, and it doesn't handle objects. Fast movement can leave soft or smeared edges. no_person means most of the range has nobody clearly visible.
|
|
17
|
-
- Without WebGPU the tool is several times slower and accepts up to 1,800 frames at a time; with WebGPU, 5,400.
|
|
18
|
-
- Frames stay on this computer. Scene-embedded video and remote URLs aren't supported.
|
|
19
|
-
- Files go to assets/cutouts/. Use Undo, or delete the clip, to remove a cutout.
|
|
1
|
+
# Graphics behind a person
|
|
2
|
+
|
|
3
|
+
Use agentcut_cutout_person when the user wants text or a graphic behind someone, or the person in front of something. Do not install segmentation packages, write background-removal scripts, export frames or use image APIs.
|
|
4
|
+
|
|
5
|
+
The stack, top to bottom: the person cutout, the graphic, the original footage. The footage stays in place, so a slightly loose edge only shows where the graphic touches the person.
|
|
6
|
+
|
|
7
|
+
1. Add the graphic on a track above the footage first, and note its clip ID and frames.
|
|
8
|
+
2. Call agentcut_cutout_person with the footage clipId, fromFrame and durationInFrames covering only the frames where the graphic is on screen, and behind with the graphic's clip ID. Cutting out only those frames is much faster than the whole clip. The first run also downloads a model of about 26 MB.
|
|
9
|
+
3. Check captures at the start, middle and end of the range, and where the graphic overlaps the person. Look at hair, hands and fast movement.
|
|
10
|
+
|
|
11
|
+
The tool adds a muted video clip to a track named Person cutout. Keep captions on a track above the cutout so the person doesn't cover them.
|
|
12
|
+
|
|
13
|
+
- To grade a person apart from their background, use `agentcut_grade_subject` instead (see `references/color.md`).
|
|
14
|
+
- It copies the footage clip's trim, speed, box, crop, fit and grade once. After changing those, or moving the footage, run the tool again with the same range; it replaces the earlier cutout on that range.
|
|
15
|
+
- A range can't start or end inside an enter or exit animation of the footage, and a project style camera needs the whole clip: the tool returns needs_full_clip, so omit the range.
|
|
16
|
+
- Works on the person in front; it can't choose between people, and it doesn't handle objects. Fast movement can leave soft or smeared edges. no_person means most of the range has nobody clearly visible.
|
|
17
|
+
- Without WebGPU the tool is several times slower and accepts up to 1,800 frames at a time; with WebGPU, 5,400.
|
|
18
|
+
- Frames stay on this computer. Scene-embedded video and remote URLs aren't supported.
|
|
19
|
+
- Files go to assets/cutouts/. Use Undo, or delete the clip, to remove a cutout.
|