video-capture
Film the real product for a video instead of redrawing it by hand. Records a scripted run of a local web UI with Playwright and real terminal commands with their real output, as clips and frame sequences a video-basic card can show. Use when a video should show what the software actually looks like.
npx skills add rtorcato/video-ai --skill video-capture
video-basic rules say accuracy over polish, yet a hand-drawn HTML card is a guess at the product. This skill films the real thing and hands the result to a card as a numbered frame sequence.
Needs: Python 3 with pip install playwright (then playwright install chromium, or an installed Chrome, or CHROME=/path/to/chrome), and ffmpeg. No other dependencies; the terminal recorder is built in.
1. Capture
Copy scripts/capture.py and scripts/capture.js next to your video page, then:
# a local web UI: serve it first (or use a file:// URL), list the steps in steps.json
python3 capture.py web http://localhost:3000 captures/app --steps steps.json --size 1280x720 --fps 30
# real commands: each is run, its real stdout and stderr are kept, then replayed as a terminal
python3 capture.py term captures/cli --size 1280x720 -- "mytool init" "mytool run --dry"
web steps (steps.json): wait (ms), click (sel), fill / type (sel, text), press (key), scroll (y), goto (url). Clicks and typing are paced so they read on film. --hold S keeps the last state on screen.
term runs each command in a pty with NO_COLOR=1, keeps what it printed and when, and films a replay: the command types out, the output appears when it did, and waits longer than --max-gap (0.6s) are shortened. --cwd sets the directory the commands run in. A non-zero exit is filmed as is and reported on stderr. session.json holds the exact commands and output, so you can quote it in the script and check the video says what the tool really does.
Each capture folder holds clip.mp4, frames/00001.jpg…, capture.json and capture.meta.js.
2. Show it in a card
<img id="shot">
<script src="captures/app/capture.meta.js"></script><script src="capture.js"></script>
<script>
const app = Capture.load('app', 'captures/app'); // folder name, then its path
// in render(t): app.show(document.getElementById('shot'), t - sceneStart); // pass true as a 3rd argument to loop
</script>
Frames are plain images, so the page stays a pure function of t and render.py films it as usual. Put the <img> inside any card, and size it by CSS. Use --size at capture time near the size it will appear at so text stays sharp. For a card showing a clip rather than frames, use clip.mp4 in an editor or video-pro.
3. Check
Run render.py stills at a few times and look: the web UI should show the real state, the terminal should show the real output. The capture-demo example (make.sh, in the repo's examples folder) does the whole loop for a local page plus a terminal session and renders them side by side in one card.
Don't capture pages you don't own or that show secrets, tokens or personal data; the frames are filmed exactly as rendered.