Skip to content

Open source CapCut alternative.

TypeScript

feat(site): tell a replica's glow and tints apart from what no edit removes [rebuild]

David Le978a0c74f233
diff --git a/site/src/cut/lib/aiTools.ts b/site/src/cut/lib/aiTools.ts
index 7cc18c76..6920c0b1 100644
--- a/site/src/cut/lib/aiTools.ts
+++ b/site/src/cut/lib/aiTools.ts
@@ -840,7 +840,7 @@ const SWEEP_NOTE =
"worst lists the stretches most off, worst first, each with its peak frame (at on the cut, source on the source) and that frame's 4×4 grid, top row first. " +
"edges lists stretches whose difference runs along whole edges of the frame (top, bottom, left, right) while the middle matches: a border, band or letterbox one side has and the other lacks. Thin bars barely move the mean, so these come back under target too. The picture box is already cut out of any app around it, so a band inside it is part of the picture, never the recording's: build it. " +
"titles lists titles whose letters read another colour than the source's under them, ink yours and sourceInk the source's: a small label in the wrong colour barely moves the score, so set each one's color to what the source draws. " +
- "Look at them: compare_to_source with times [{at, source}] at those peaks, fix what differs, then sweep again, until the median is under target and each stretch in worst and edges is fixed or is a difference no edit removes. " +
+ "Look at them: compare_to_source with times [{at, source}] at those peaks, fix what differs, then sweep again, until the median is under target and each stretch in worst and edges is fixed or sits over a block standing in for footage, the one difference no edit removes: a glow, a tint, a blurred or soft edge, a flash are all built, so a stretch over what you built is yours to fix. " +
"shift on a stretch, or timing for the whole span, means the source matches better that many seconds away: positive, move it later by that much; negative, earlier. " +
"onBlocks is the share of samples over blocks standing in for footage; those keep a difference no edit removes.";
/** Faces suggest_font hands back by default, and at most. */
diff --git a/site/src/cut/server/ai/catalog.ts b/site/src/cut/server/ai/catalog.ts
index 0312bde5..3f035d33 100644
--- a/site/src/cut/server/ai/catalog.ts
+++ b/site/src/cut/server/ai/catalog.ts
@@ -365,7 +365,7 @@ Someone points at a video — a file they imported, a link you brought in, a cli
**Then the motion.** set_overlay_keyframes gives each card its own pose track — where it sits, at what scale, at what second. track_element over a move hands you the keys: each move's from/to, start/end and ease, with scale as w over the resting w. set_overlay_animation composes on top for the entrance, the exit, a loop, and what a line does while it holds; 0.3-0.6s reads as an entrance, and a per-letter style is what makes a card read as typed. A line whose letters land one at a time is a per-letter entrance read off detect_cuts' \`changes\`, and it is read in one call, never by eye from sheets: track_element with match letters, the line's \`text\`, a seed close around the landed line, \`from\` before the first letter shows and \`to\` just after the last one lands. Its \`entrance\` is the set_overlay_animation call — in_style, in_seconds, in_stagger, in_sequence, in_sequence_at, in_distance, in_ease, in_fade, in_blur — and \`starts\`, the source second the title's ramp begins; pass them as they come. Its \`crosses\` says whether the letters pass in front of or behind other ink on their way in — a smaller line above them — and so which of the two takes the lower row. motion_blur on the element (update_overlay) is for letters that streak along their fall; one that comes in soft is in_blur. add_shape, a stretch per call, is the rest of the graphics: bars, cards, rules, a block of color behind a line.
-**Look at what you made.** A build that reads right from your own notes is still a guess until you measure it. compare_to_source does: mode sweep scores every frame of the cut against the source — 0 is the same picture, under ${SWEEP_TARGET} reads as one — and names the worst stretches with a grid of where each differs; mode moments shows those peaks beside the source's frames. Sweep as you build, since an error in the first card is in every card after it: look at the worst stretches, fix what differs, sweep again, and stop when the median is under ${SWEEP_TARGET} and no stretch stands out. A \`shift\` means the right thing lands early or late by that much. Read each picture for colour, the words and their face, where a thing sits, its size, and how far along a move is; a title the same colour as the block behind it reads as correct in the document and shows up here, and a sweep's \`titles\` names each title whose letters are another colour than the source's. A block keeps its footage's difference, so judge a shot by the cells over what you built.
+**Look at what you made.** A build that reads right from your own notes is still a guess until you measure it. compare_to_source does: mode sweep scores every frame of the cut against the source — 0 is the same picture, under ${SWEEP_TARGET} reads as one — and names the worst stretches with a grid of where each differs; mode moments shows those peaks beside the source's frames. Sweep as you build, since an error in the first card is in every card after it: look at the worst stretches, fix what differs, sweep again, and stop when the median is under ${SWEEP_TARGET} and no stretch stands out. A \`shift\` means the right thing lands early or late by that much. Read each picture for colour, the words and their face, where a thing sits, its size, and how far along a move is; a title the same colour as the block behind it reads as correct in the document and shows up here, and a sweep's \`titles\` names each title whose letters are another colour than the source's. A block keeps its footage's difference, so judge a shot by the cells over what you built. That is the only difference no edit removes: a glow, a tint on type, a soft edge or a flash is built like everything else (a glow is a bright shadow at shadow_y 0 on the title or shape, keyed in by the opacity of a copy that wears it), so a stretch over what you built stands out until you build it.
**Say what plays.** Close by naming what fills the shots — each Pexels id by shot — and what you checked. A shell gets what to drop in: how many shots, how long each one runs, and that the titles and timing are built around them.`,