For months, making a narrated demo meant babysitting a pile of clips. Version 1 of screencast-tutorial worked — TypeScript, Playwright, one browser recording per narration line — but it dragged along a Node pipeline, a bundled browser stack, credentials in config, and a fragile stitch step. Change one selector and the whole take was garbage.
So I started over. Version 2 is a separate Rust CLI that drives Vercel's agent-browser. It records one continuous take, generates narration with free edge-tts, and lets the audio decide where the cuts go. screencast-v2 all --script demo.json runs the whole thing.
What v1 got wrong
Three things made v1 painful in day-to-day use:
- A clip per sentence. Every narration line meant a separate browser recording, then a stitch step. The result had visible jump cuts, and one failed gate could ruin a take.
- Playwright-shaped scripts. Selectors and actions were tied to Playwright syntax, so scripts were hard to reuse and hard to repair when a UI changed.
- Too much runtime. Node, Playwright, and a browser stack sat between the script and the video, plus secrets that had to be configured before anything worked.
The v2 pipeline
The CLI has six commands, plus all for the full run:
| Command | What it does |
|---|---|
init | Writes starter config and script files |
inspect | Walks app routes in a named agent-browser session and dumps observed selectors |
validate | Replays every script gate against the live app |
audio | Synthesizes and caches narration, measures real durations |
record | Records one continuous browser take with timing markers |
merge | Cuts, pads, normalizes and concatenates into final MP4s |
all | Runs audio → record → merge for one script |
The old skill directory is untouched. v2 lives in its own repo and installs as a standalone binary; there is no local build step for users.
Audio first, measured not guessed
The biggest change is ordering. audio runs before the browser opens.
Each script segment is synthesized with edge-tts — free and keyless — through uv tool run (or an EDGE_TTS_BIN override). Clips are cached by voice plus exact narration text, so reruns reuse audio instead of re-synthesizing. ffprobe measures the real duration of every clip, and the stage writes a per-script manifest that the later stages consume.
No more guessing how long a sentence takes to say. The audio is ground truth.
Inspect, then validate
inspect drives the app through a named agent-browser session, with auth setup and optional navigation discovery, and dumps the selectors it actually observed. That dump is the starting point for a script.
validate then replays every gate on the live app before any recording starts. A stale selector fails early, cheaply, instead of 40 seconds into a take.
Scripts keep the CSS selector you already wrote. They can also carry an optional semantic target — role, text, label, placeholder or testid — and that target wins when present. It is a small hybrid: keep existing assets, add a stable semantic locator where it helps.
One continuous take
record settles the browser first: auth, warm-up gates, everything that should not appear in the video. Only then does it call agent-browser's record start. From that moment, every timing marker is measured against the exact start of recording.
Each step holds for the duration of its narration audio plus a 1.2-second tail, with a 3.5-second floor so short steps never flash by. There is no cut-and-splice and no jumpy transition — the video is one real-time browser session.
Audio sets the pace in merge
merge uses the measured narration and timing JSON to cut that single take into segments. It caps silent lead at 2.5 seconds, freeze-pads a short tail instead of stretching it, applies loudnorm, re-encodes at 30fps, and concatenates the segments into the final MP4.
Nothing is time-stretched, so voices never sound wrong. The math is carried over from v1, which had already been tuned against real recordings.
Why Rust and agent-browser
The whole CLI is a small Rust binary with minimal dependencies and synchronous std::process::Command calls. It orchestrates tools that already do their jobs well: agent-browser owns the browser and the video capture, edge-tts owns speech, ffmpeg and ffprobe own audio and encoding.
That means no bundled browser automation stack, no API key for narration, and one installable binary from GitHub Releases. Stable asset names mean releases/latest/download/... keeps working across versions. CI is the only build authority — I never compile locally.
What I deliberately did not build
There is no YouTube upload in v0.2.0. There is also no magic that makes missing prerequisites appear: real use needs edge-tts available, an ffmpeg build with libx264, and a running target app. The skill docs cover the checklist, including agent-browser doctor.
I also have not run a live end-to-end recording on my own machine yet — my local ffmpeg lacks libx264, uv/edge-tts are not installed here, and there is no target app running. The pipeline is shipped and CI-verified; the first real recording is the next test.
Try it
Download the binary for your platform from the releases page, then:
screencast-v2 init --dir demo
screencast-v2 inspect --config demo/config/app.config.json
screencast-v2 validate --config demo/config/app.config.json --script demo/config/script.example.json
screencast-v2 all --config demo/config/app.config.json --script demo/config/script.example.json
The repo is XyrusCode/screencast-tutorial-v2, MIT licensed. If you make product demos or onboarding videos, I would like to know what you would record first.
