--- name: site-reels description: 'Records a site/app''s best scenes (WebGL, 3D, scroll) as 1080p MP4, uploads to Figma Slides, and builds brand/product showreels in Remotion or HyperFrames (logo reveal + branding burst). Use on "record the site scenes", "site video for the deck", "showreel", "launch video", "gerar vídeo do site", "vídeo pro deck", "reel do produto", /site-reels.' metadata: family: video --- # Site Reels: site → MP4 → deck > **Tempero:** In a showreel, the transitions, texture and overlays draw on the brand's own tools, deck and plates, and the cuts follow its rhythm. A showreel takes the full dose. Creative direction, with the dose for each piece: [tempero.md](../visant-methodology/references/tempero.md). ## Requirements | Needed for | What | Check | |---|---|---| | everything | Windows, macOS or Linux with a GPU and a visible desktop (Chrome runs headful) | n/a | | everything | Node.js 18+ | `node -v` | | everything | ffmpeg + ffprobe on PATH (or `FFMPEG=`) | `ffmpeg -version` | | everything | Chrome, Chromium or Edge (auto-detected, see below) | `node -e "import('./scripts/find-chrome.mjs').then(m=>console.log(m.findChrome()))"` | | `record.mjs` | `puppeteer-core` + `puppeteer-screen-recorder` (npm, in the project) | `npm ls puppeteer-core puppeteer-screen-recorder` | | `snap.mjs` | `puppeteer-core` + `timesnap` (brings `timeweb`) | `npm ls timesnap` | | showreel | Remotion project | `npx remotion --version` | | audits (optional) | ImageMagick | `magick -version` | | Figma upload | Figma MCP (`use_figma`, `upload_assets`) + skills `figma-use`, `figma-use-slides` | MCP tool list | **Chrome detection** (`scripts/find-chrome.mjs`, used by `record.mjs` and `snap.mjs`): `CHROME` env var if set; else installed Chrome/Edge (Windows: Program Files and LocalAppData; macOS: `/Applications` and `~/Applications`; Linux: `google-chrome`, `chromium`, `microsoft-edge` on PATH); else the newest `ms-playwright/chromium-` (or `PLAYWRIGHT_BROWSERS_PATH`); else it stops and tells you how to set `CHROME` or run `npx playwright install chromium`. On Windows it adds `--use-angle=d3d11`; on other OSes Chrome keeps its default GPU backend. ## What it does Records scripted scenes of a site running locally and delivers MP4s ready for Figma (1920×1080, 30fps, x264, < 100MB). Validated engine: **puppeteer-core + puppeteer-screen-recorder** (CDP screencast + ffmpeg). Never screen-record. ## Run ``` mkdir -reels && cd -reels && npm init -y && npm i puppeteer-core puppeteer-screen-recorder mkdir -p scripts && cp /scripts/{record,find-chrome}.mjs scripts/ cp /scripts/scenes.example.mjs scenes.mjs # edit the scenes # in the site repo: npx next build && npx next start -p 3100 (production build: smoother WebGL) OUT="/Videos" node scripts/record.mjs scenes.mjs [scene ...] ``` Run the scripts **copied into the project**: ESM resolves `puppeteer-core` from the script's folder, not from the cwd. Env: `BASE` (default `http://localhost:3100`), `OUT`, `CHROME`, `FFMPEG`, `W`, `H`, `DPR`, `MOBILE=1` (touch emulation), `KEEP_UI=1` (keeps the nav), `MIN_FPS` (24). Phone 4:5: `W=360 H=450 DPR=2 MOBILE=1` gives 720x900. Each scene = `{ name, path, theme?, trim?, crf?, css?, prepare(page, ctx), act(page, ctx) }`. `prepare` runs before recording (scroll to the section, wait for 3D to load); `act` is what goes into the video. `ctx` has `wait`, `scrollTo(page, y|selector, ms)` and `scrollThrough(page, selector|null, ms, from, to)` with easing. Intro that runs on load: `page.reload()` inside `act` and use `trim` to cut the loading. Brand script that works: logo/hero intro (light and dark), hero media swap, 3D section with the camera entering on scroll, immersive route (walk), footer wordmark and one full page pass. 5–7 scenes of 12–55s. ## Audit before delivering (do not trust the exit code) - Contact sheet per video: `ffmpeg -i x.mp4 -vf "fps=6/,scale=480:-1,tile=3x2" -frames:v 1 sheet.png` and **look**. - 1MB for 19s = blank scene. > 100MB = does not go into Figma (scene `crf` fixes it; 24 for a scene with grain + trails). - Top strip (`crop=1920:120:0:0`) at several times to catch a leaking nav. - `LOW-FPS` with a long pause at the start/end is a false alarm (the meter counts still frames); check the contact sheet. - Designed brand films: run the release-level pass in `references/showreel-variants.md` (one palette via `scripts/duo.sh`, a returning motif, real media before faceless stock, no dead frames). Then `blackdetect` the render and patch isolated black frames with `scripts/tapar-pretos.sh`. ## Known pitfalls 1. **Hidden window freezes rAF** → frozen frames. The launch already passes `--disable-backgrounding-occluded-windows --disable-renderer-backgrounding --disable-background-timer-throttling --disable-features=CalculateNativeWinOcclusion`. `headless: false` on purpose: headless falls back to SwiftShader and WebGL stutters. 2. **Hide-UI CSS disappears** on reload and when React hydration clears `` → the script re-attaches a `