Repeatable Site Demo Reels with Claude Code, webreel, and Remotion
How we evolved a one-off webreel + Python site trailer into a repeatable Remotion 4 studio — with swappable TheFocus.AI bumpers, an interactive bumper picker, a drop-in reel.json format, and one-command cuts for Slack, X, and YouTube.
Our first attempt at agent-directed video — making a 76-second trailer for the umwelten dialogue explorer — proved a useful thesis: you can describe shots to an AI agent in plain English, let webreel drive headless Chrome, inspect the rendered frames together, and ship a real product trailer without touching a timeline editor.
It also exposed a ceiling. All of our post-production lived in a bespoke 150-line Pillow script (cinematic.py) glued to hand-rolled ffmpeg filtergraphs. Every new video meant rewriting pixel-crop math, end cards, speedup badges, and aspect-ratio crops from scratch.
Splitting the pipeline turns that one-off trick into a repeatable workshop studio inside video/:
webreelis the camera crew — it drives headless Chrome against static built pages (?reel=1so timed modals stay hidden) and emits clean, modular scene clips.Remotion 4is the finishing house — it wraps any clips, screenshots, or typographic cards in swappable TheFocus.AI branded bumpers, evaluates declarative camera keyframes, synthesizes stereo bumper stings and ambient beds, and compiles four channel cuts (internal,x,x-square,youtube) from onereel.jsonmanifest.
Here is the pipeline running live on this site today. Switch channels on Demo 01 below to watch the bumper and frame geometry adapt from 16:9 YouTube (paper-editorial) to an uncropped 1:1 X feed card (issue-plate) or a 1.5s internal engineering clapper (minimal-slate):
And here is Demo 02 on the dark Operational Ledger aesthetic (ledger-command), walking through two live interactive notebooks on Labs — the Org Age factory simulator and the Drive EmbeddingGemma 2 + SQLite sizer:
Step 1 — Isolate Remotion and teach the agent both skills
Keep Remotion and its headless Chromium dependencies inside a standalone video/ package so the root Astro site’s pnpm-lock.yaml stays untouched during production CI builds:
mkdir -p video && cd video
pnpm init
pnpm add remotion @remotion/cli @remotion/bundler @remotion/renderer \
@remotion/media @remotion/transitions @remotion/google-fonts @remotion/zod-types \
react@^18.3.1 react-dom@^18.3.1 zod@4.6.7 webreel@0.1.4
pnpm add -D tsx typescript @types/node @types/react @types/react-dom
Remotion requires exact matching patch versions across remotion and every @remotion/* package (4.0.543 here — run pnpm exec remotion versions if builds ever complain). Next, give your agent both the recorder skill and the Remotion skill (plus our repo’s workflow skill at .agents/skills/demo-reel/SKILL.md):
npx skills add vercel-labs/webreel
npx skills add remotion-dev/skills
Teaching an AI agent Remotion’s #1 architectural rule up front saves hours of broken renders:
Frames render out-of-order across parallel headless Chrome workers. Never use CSS
transition, CSS@keyframes,requestAnimationFrame, orsetTimeout. Every transform, opacity, clip-path, typography wipe, and audio envelope must be a pure function ofuseCurrentFrame()anduseVideoConfig().
In React + Remotion, that boils down to two functions:
interpolate(frame, [startFrame, endFrame], [fromValue, toValue], { extrapolateLeft: 'clamp', extrapolateRight: 'clamp' })for linear or cubic-bezier ramps (always clamp both ends or values overshoot before/after your cue).spring({ frame, fps, config: { damping: 16, stiffness: 190, mass: 0.7 } })for physical mechanical lockups — crosshairs rotating into alignment, clapper arms snapping shut, and CTA stamps landing with weight.
Step 2 — What a bumper actually is in Remotion
A bumper is a parameterized React component (BumperProps -> JSX) that opens (variant="intro") and closes (variant="outro") a reel using the reel’s metadata (title, subtitle, department, issueTag, ctaUrl) and active canvas geometry (aspect === '16:9' or '1:1').
Because static posters fade invisibly into static title cards, every TheFocus.AI Labs bumper uses a two-beat kinetic structure + synthesized audio sting:
- Beat 1 (
frames 0–24): An unmistakably animated TheFocus.AI Labs brand ident (e.g., an inverted ink studio banner expanding with spinning+crosshairs, a sweeping#556b2fledger scanbar, or a hinged diagonal clapper arm snapping shut at frame 10). - Beat 2 (
frames 22+): The ident docks into the masthead and wipes in the reel title, italic Sorts Mill Goudy deck, and stamped issue badge — keeping a live timecode/progress ruler moving until<TransitionSeries>wipes into Scene 1.
Click through all five registered bumpers below to compare their intro stings and closing colophon plates side-by-side:
Here is the core mechanics inside video/src/bumpers/MinimalSlateBumper.tsx — a hinged diagonal clapper arm that stays cocked open at -9deg through frame 7 and snaps shut to 0deg on frame 10 in lockstep with a synthesized 1.2s wood-and-pip WAV sting:
import { Audio } from '@remotion/media';
import { AbsoluteFill, interpolate, staticFile, useCurrentFrame } from 'remotion';
export const MinimalSlateBumper: React.FC<BumperProps> = ({ title, subtitle, id }) => {
const frame = useCurrentFrame();
// Cocked at -9deg frames 0..7, snaps shut on frame 10, settles by frame 12
const clapAngle = interpolate(frame, [0, 7, 10, 12], [-9, -9, 0.8, 0], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
});
return (
<AbsoluteFill style={{ backgroundColor: '#e9e6da', padding: 80 }}>
<Audio src={staticFile('audio/sting-slate.wav')} volume={0.45} />
<div
style={{
height: 22,
transformOrigin: '0% 100%',
transform: `rotate(${clapAngle}deg)`,
backgroundImage: 'repeating-linear-gradient(-45deg, #1a1a1a 0 24px, #f3f2ea 24px 48px)',
}}
/>
<h1>{title}</h1>
<p>{subtitle}</p>
</AbsoluteFill>
);
};
Because every audio bed and bumper sting (sting-paper.wav, sting-ledger.wav, sting-slate.wav) is generated in pure PCM TypeScript (video/scripts/gen-audio.ts), you get tactile mechanical sound design with zero external sound-library downloads or API keys.
To develop and audition bumpers while iterating:
pnpm run video:bumpers # renders MP4 + PNG previews into video/out/bumpers/index.html
pnpm run video:studio # opens Remotion Studio (http://localhost:3000) with live dropdowns
Step 3 — Recording modular browser scenes with webreel
Keep each shot short (6–15s) and self-contained inside video/reels/<slug>/webreel.config.json. Splitting the tour into 01-front-desk.mp4, 02-newsstand.mp4, and 03-archive-search.mp4 means changing one page later only requires re-shooting one short clip — never a brittle 90-second take.
Three hard-won webreel lessons from our first trailer still hold:
- Suppress timed UI modals on
?reel=1andnavigator.webdriver. OurNewsletterPopup.astrowaits 30 seconds on public visits; addingif (navigator.webdriver || new URLSearchParams(window.location.search).has('reel')) return;ensures it never pops mid-take. - Focus first, type without a
selector. Inwebreel 0.1.4, puttingselectorinside{ "action": "type", ... }can drop keystrokes. Focus the input via shortcut (mod+k) or click (cmd+a), then run{ "action": "type", "text": "..." }. - Avoid native OS
<select>menus and dev toolbars. Native dropdowns live outside the compositor and are invisible to headless video; record against built staticastro previewrather thanastro devso the Astro dev overlay never photobombs your corners.
{
"$schema": "https://webreel.dev/schema/v1.json",
"outDir": "./clips",
"baseUrl": "$BASE_URL",
"viewport": { "width": 1920, "height": 1080 },
"videos": {
"03-archive-search": {
"url": "/?reel=1",
"fps": 30,
"quality": 85,
"waitFor": "#open-search-modal",
"output": "03-archive-search.mp4",
"steps": [
{ "action": "pause", "ms": 400 },
{ "action": "key", "key": "mod+k", "delay": 550 },
{ "action": "type", "text": "multimodal", "delay": 650 },
{ "action": "hover", "selector": ".search-result-item", "delay": 700 },
{ "action": "click", "selector": ".search-result-item", "delay": 900 }
]
}
}
}
Step 4 — How Remotion replaces cinematic.py and raw ffmpeg
Inside video/src/, three small Remotion files replace all custom Python cropping and ffmpeg filtergraph choreography:
1. Declarative transitions & chapter timing (ReelComposition.tsx)
@remotion/transitions provides <TransitionSeries>, which overlaps adjacent sequences by TRANSITION_FRAMES = 12. We use a hard directional wipe({ direction: 'from-right' }) out of the intro bumper into Scene 1 — making the handoff from brand plate to live browser unmistakable — a subtle fade() between browser scenes, and a wipe({ direction: 'from-left' }) into the closing colophon:
<TransitionSeries>
{timeline.segments.map((seg, idx) => (
<React.Fragment key={seg.id}>
<TransitionSeries.Sequence durationInFrames={seg.frames}>
{renderSegment(seg)}
</TransitionSeries.Sequence>
{idx < timeline.segments.length - 1 && (
<TransitionSeries.Transition
presentation={seg.kind === 'intro' ? wipe({ direction: 'from-right' }) : fade()}
timing={linearTiming({ durationInFrames: 12 })}
/>
)}
</React.Fragment>
))}
</TransitionSeries>
Because computeTimeline() in video/src/timeline.ts subtracts those exact 12-frame overlaps per cut, it automatically prints sample-accurate 00:00 YouTube chapter markers alongside the rendered video.
2. Frame-accurate playback & camera keyframes (SceneStage.tsx)
Inside Remotion, regular HTML <video> drifts when rendering frames out of order. @remotion/media’s <OffthreadVideo /> decodes exact frame numbers via native FFmpeg inside the renderer — so even a 1.45× sped-up scene stays razor sharp while we overlay our browser chrome, caption plate, and ▸▸ 1.45× HUD pill:
<OffthreadVideo
src={staticFile(scene.stagedClip)}
trimBefore={Math.round(scene.trimStartSec * fps)}
playbackRate={scene.playbackRate * speedMultiplier}
volume={clipVolume}
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
/>
Camera zoom-and-pan moves (evaluateCamera(scene.camera, progress)) interpolate normalized { atProgress, scale, x, y } keyframes using Easing.bezier(0.22, 1, 0.36, 1) CSS transforms — zero Python matrix loops, and every frame previews live in Remotion Studio.
3. One composition, four channel formats (Root.tsx)
Remotion’s calculateMetadata lets a single <Composition /> compute its own width, height, and durationInFrames from props, and passing a Zod schema (StudioControlsSchema) turns Remotion Studio’s right-hand sidebar into live dropdowns:
<Composition
id="ReelStudio"
component={StudioWrapper}
schema={StudioControlsSchema}
durationInFrames={240}
fps={30}
width={1920}
height={1080}
defaultProps={{ reelId: '01-labs-magazine-tour', bumperOverride: 'manifest', channel: 'youtube' }}
calculateMetadata={async ({ props }) => {
const resolved = getStudioReelProps(props);
const timeline = computeTimeline(resolved);
const profile = CHANNEL_PROFILES[resolved.channel];
return { durationInFrames: timeline.durationInFrames, fps: 30, width: profile.width, height: profile.height };
}}
/>
When channel switches to x-square (1080×1080), SceneStage.tsx does not crop the sides off your webpage — it stacks the full 16:9 browser window cleanly between a bold editorial title header and an oversized lower-third card, paired with IssuePlateBumper.
Step 5 — The standard drop-in reel.json & one-command exports
You don’t even have to run webreel. Any screen recording (.mp4), screenshot (.png), or pure typographic card dropped into video/reels/<slug>/clips/ works inside the same schema:
{
"$schema": "../../schema/reel.schema.json",
"id": "01-labs-magazine-tour",
"title": "Inside TheFocus.AI Labs",
"subtitle": "Quarterly issues as the front desk, a back-issue newsstand, and instant ⌘K archive search.",
"bumper": "paper-editorial",
"theme": "paper",
"audio": { "bed": "ambient-paper", "bedVolume": 0.14 },
"scenes": [
{
"id": "front-desk",
"clip": "clips/01-front-desk.mp4",
"eyebrow": "01 // THE FRONT DESK",
"caption": "Issue №9 Soft Clay opens with live discoveries and Drive benchmark schematics.",
"playbackRate": 1.15,
"camera": [
{ "atProgress": 0.0, "scale": 1.0, "x": 0.5, "y": 0.5 },
{ "atProgress": 0.55, "scale": 1.24, "x": 0.62, "y": 0.36 },
{ "atProgress": 1.0, "scale": 1.0, "x": 0.5, "y": 0.5 }
]
}
],
"channels": {
"internal": { "bumper": "minimal-slate", "speedMultiplier": 1.15 },
"x": { "bumper": "issue-plate", "speedMultiplier": 1.15 },
"x-square": { "bumper": "issue-plate", "speedMultiplier": 1.15, "captionScale": 1.08 },
"youtube": { "bumper": "paper-editorial", "speedMultiplier": 1.0 }
}
}
From there, video/scripts/cli.ts drives @remotion/bundler (bundle()) and @remotion/renderer (selectComposition(), renderMedia(), renderStill()) across all 4 channels and writes a share-pack.json manifest:
pnpm --dir video run new my-feature-demo --bumper paper-editorial
pnpm run video:record -- my-feature-demo
pnpm run video:render -- my-feature-demo --channel all
One render pass outputs internal.mp4, x.mp4, x-square.mp4, youtube.mp4, channel posters, a split-panel youtube-thumbnail.jpg (containing a live UI preview + chapter slate so posters never look identical to the opening bumper), youtube-chapters.txt, and share-pack.json.
whichllm: pick a local model that is actually fast
whichllm ranks the best local models for your hardware — general, coding, vision, math — then whichllm run downloads the top pick and starts a chat. --speed fast keeps only the ones estimated at 30+ tok/s.
Adapting Qwen 3.8 27B to the π Coding Harness on Apple Silicon
Testing harness-hub's RL LoRA for the π agent on a 64 GB M4 Max: why Q4_K_M hits 19.45 tok/s (+34% over Q8) while Q3_K_M regresses on Metal, how to keep .pi project-local with mise, and timing agent loops from llama.cpp Prometheus counters.
Practice leads to Theory
Grown not built, discovered not developed