Capture a site for a video by writing a project's capture.ts (stills and takes with captureShots). Use when adding or redoing a shot, or when a shot blanks, times out or misses its target.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Video Capture?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/glips-video-capture)
---
name: video-capture
description: Capture a site for a video by writing a project's capture.ts (stills and takes with captureShots). Use when adding or redoing a shot, or when a shot blanks, times out or misses its target.
---
# Capturing
The studio's projects live under `$(studio home)`: run `studio home` and use absolute paths for Read and Edit.
A project's `capture.ts` declares named shots with `captureShots`, whose header comment and types are the API.
`studio capture <p>` films them into `captures/`; `--only=a,b` redoes just those. The shape a real one settles into:
```ts
import { captureShots, type Page } from '#lib/footage/capture/engine/capture.ts';
const PDP = 'https://shop.example.com/products/widget';
// A chat teaser that arrives at random would flicker between states that crossfade.
const HIDE_POPUPS = '#chat-teaser { display: none !important; }';
const BOX = { price: '.price', stepper: '.buy-box quantity-input', plus: '.buy-box button[name="plus"]' } as const;
const shots = captureShots({
project: import.meta.dirname,
viewport: { width: 1440, height: 810 },
css: HIDE_POPUPS,
prepare: async (page) => { /* once per device, kept by every shot: sign in, accept the cookie banner */ },
devices: { phone: { viewport: { width: 390, height: 844 } } },
});
const open = async (page: Page, url: string) => {
await page.goto(url, { waitUntil: 'load' });
await page.waitForTimeout(3000);
};
shots.still('box', { setup: (page) => open(page, PDP), rects: BOX, height: 1400 });
// Each state is its clicks from a fresh page, so it can be redone alone.
shots.still('box-three', {
setup: async (page) => { await open(page, PDP); for (let i = 0; i < 2; i++) await page.locator(BOX.plus).click(); },
rects: BOX,
height: 1400,
});
shots.take('step-up', { setup: (page) => open(page, PDP), perform: (rec) => rec.click(BOX.plus, { mark: 'plus' }) });
export default shots;
```
Name the rect maps once and share them between shots, and comment each workaround with what it hides or waits for
and why.
Find selectors with `studio probe <p> <url-or-path>`: it opens the page as the shots will, signed in and styled, and
lists elements with rect specs and match counts. Reach for it before any throwaway Playwright script.
Done when `studio capture <p>` films every shot and each rect a scene asks for is in `captures/index.ts`.
## Still or take
- **Still**, the default: a high-DPI screenshot plus the page rects of what scenes point at. Cameras pan and zoom over
it, and a state change dissolves between two stills of the same page. Close-ups whose point is sharpness stay here;
take frames are JPEG.
- **Take**: a screencast of real clicks, scrolls and typing, for where the viewer must watch the action happen (a
carousel sliding, a menu opening) and a cut between stills would jump. Takes film in real time, one at a time, at the
site's pace; the scene fits them to the voice later, and `studio check` warns past 1.6×, where they read rushed, so
leave `wait`s where a read needs room.
## Every shot stands alone
- `setup` takes a fresh page to its state by itself, so `--only=name` redoes that shot alone. Shots share helper
functions, never order.
- `prepare` runs once per device before any shot (a preview cookie, a consent click). Each shot gets its own context
seeded from it, so a cart add in one shot never shows in another.
- What `setup` returns goes to `data` (what a screenshot can't hold, such as a native menu's option names, for the
scene to redraw) and to a function `scrollY`.
- `scrollY` captures just the viewport, scrolled there: the way to show a sticky bar where a visitor sees it.
- A rect that matches nothing throws unless it's `optional`, so a finished capture holds every rect scenes ask for.
- Anchor a rect's `text` regex (`'^Sign in$'`), or longer text containing the words matches too.
## Sites behind a sign-in
- `prepare` signs in once per device, and every shot starts from its cookies.
- Credentials come only from environment variables the user names: read `process.env.X` in `capture.ts`, and have
the user run `studio capture` under their secret launcher. Keep them out of files and out of your own search; if
none are given, ask. Where the product runs locally, film a demo instance on seeded data with its own throwaway
password.
- A sign-in form ignores submits until the app hydrates, though its fields keep what's typed. Call
`waitForHydration(page, submitSelector)` before filling it, rather than `networkidle` or a fixed timeout.
## Takes
- `setup` reaches the opening frame off camera; `perform(rec)` is what's filmed. The studio draws the cursor from the
log.
- Each `rec` action takes a `mark` naming its moment and measuring `rects` then; scenes pin marks to words. Mark rects
are page coordinates, shifted by each frame's scroll, so scenes aim through `onTake`.
- Leave about a second (`rec.wait`) between marks a scene will pin to words: the stretch between two pins plays at the
pace of their words, so close marks play in slow motion.
- The frame count `studio capture` prints counts repaints, not quality: a low count over a still stretch is fine.
## Gotchas
- Live storefronts never reach `networkidle`. Wait on the specific thing: a selector, an image's decode.
- Lazy images blank mid-take as they come into view. In `setup`, set each gallery image's `loading = 'eager'` and
`await img.decode()`, off camera.
- `rec.click` throws if its target is out of view. Slide the carousel and scroll the page in `setup`.
- In a split panel the bottom ~25% of the viewport lands under the caption. Scroll so a click target sits ~60% down.
- Popups that arrive at random (an SMS teaser, a chat bubble) flicker between crossfading states. Hide them with
`captureShots({ css })`.
- Stills run four at a time, so a slow site can time out one of them. Rerun just it with `--only`.