Programmatic Video Builder
Detailed engine rules live in references/. Read only the file for the engine you are using:
references/remotion.md: Remotion project rules, fonts, audio, propsreferences/hyperframes.md: Hyperframes CLI loop and timeline rulesreferences/ffmpeg.md: FFmpeg recipes (trim, concat, overlay, mux, captions, preview)references/captions.md: producing and exporting.srtfiles
1. Pre-Flight Intake
Check whether the user has already given the four parameters below. If the brief covers them, skip this step. If any are missing, ask for them in one concise message:
- Format & Resolution:
16:9(1920x1080),9:16(1080x1920), or1:1(1080x1080). Default30fps(60fpsfor UI screen captures). - Duration: Target runtime in seconds (
durationInFrames = seconds * fps). - Engine: Remotion (React/TypeScript motion graphics, UI demos), Hyperframes (HTML/CSS/GSAP/Lottie compositions), or FFmpeg (CLI trims, stitching, overlays, audio muxing).
- Audio / Captions: Silent, a background audio file path, or a spoken voiceover script that needs
.srtsubtitles.
2. Scene Blueprint
Before creating files, output a compact frame-budget table:
| Scene | Frame Range (Seconds) | Visual Action & Motion | On-Screen Text / Audio |
|---|---|---|---|
| 1 | 0–90 (0.0–3.0s) | Hook animation | Headline + SFX |
Wait for the user to confirm the blueprint before scaffolding. Skip the wait if the user said to go ahead without approval (for example "just build it"); in that case state the blueprint and continue.
3. Styling & Platform Safe Zones
Apply these defaults unless the user gives brand rules:
- Color Palette:
- Canvas:
#0A0A0A(dark) or#FAFAFA(light) - Primary text:
#FAFAFAon dark,#111111on light - Muted / secondary:
#71717A - Accent:
#3B82F6
- Canvas:
- Typography:
Inter(500, 700) for UI and headlines;JetBrains Mono(400) for code and technical callouts. - Safe-Zone Margins:
16:9: minimum80pxon all sides.9:16: keep captions and key visuals inside180pxtop,380pxbottom (platform UI),140pxright (engagement icons),60pxleft.
4. Implementation Rules (all engines)
- Centralize timing constants: keep
FPS,WIDTH,HEIGHT, andDURATION_IN_FRAMESin one config file. Never hardcode magic frame numbers inside scenes. - Parameterize content: expose copy, colors, and media paths through typed props (Remotion) or a JSON config /
data-*attributes (Hyperframes), so variations render without code edits. - Deterministic motion only: every frame must be a pure function of time. Engine-specific rules are in the reference files.
- Load fonts before rendering any frame: the method differs per engine (see the reference files).
5. Preview & Render Protocol
- Preview first: run the engine's preview so the user can check pacing and safe zones.
- Remotion:
npx remotion studio - Hyperframes:
npx hyperframes preview(runnpx hyperframes lintfirst) - FFmpeg: render a low-res preview clip (see
references/ffmpeg.md)
- Remotion:
- Render only on explicit request. Run the final encode only when the user asks to export:
- Remotion:
npx remotion render <CompositionId> out/video.mp4 --codec=h264 --pixel-format=yuv420p - Hyperframes:
npx hyperframes render --output out/video.mp4 - FFmpeg: see
references/ffmpeg.md
- Remotion:
- Captions: whenever narration or dialogue is included, also output a synchronized
.srtfile. Seereferences/captions.md. - Verify the output: after a render, confirm resolution, fps, duration, and audio streams with
ffprobebefore reporting success.