A field-tested pipeline · every number is real

The Product Demo Playbook

How to make a YC-grade product demo video from your real app code, script, composition, frame-perfect recording, AI voiceover, sound design, and music. This is the complete write-up of a shipped demo: the actual scene table, the actual cue file, the actual ffmpeg graphs, and every failure we hit on the way.

Step 1

Know the shape of a good demo

Before touching any tool, decide what you're making. The demos that work share a shape:

Step 2

Write the story first

The script drives every other decision, scene lengths, cue times, music tempo. Write it before building anything.

2.1 The scene table

Name, duration, and the single claim for each scene. This literally becomes a JSON literal in the composition (step 4), so writing it is programming the film:

SceneSecsThe one claim
ColdOpen6Every group chat has one receipt that starts a war
TheDrop5.5Don't argue about the receipt, show it
MachineReads8Vouch reads the paper itself, every line, every price
Witness11Housemates tap what's theirs; every line gets a witness
AddsUp12Everyone sees it adds up
TheStamp11.8Vouch, three taps, no fights

2.2 Voiceover lines, one per beat

Short declaratives beat clever ones, and deadpan beats enthusiasm. Write each line with its start timecode, then iterate ruthlessly, our best line took several rejected drafts before landing on:

"Vouch reads the paper itself. Every line. Every price. Even the ink that's barely there."

Notice the structure: a claim, then two two-word hammer blows, then the detail that proves you actually built it ("the ink that's barely there", low-confidence OCR is a real product feature). The full 16-line script with timecodes is in Appendix A.

2.3 The rhythmic grid

Put repeated interactions (taps, claims) on a fixed time grid. We used 0.6 seconds, which is exactly 100 BPM. This one decision pays off three times: the interactions feel intentional instead of random, the eventual music locks to the picture with zero editing, and the sound cues land on musical subdivisions for free.

2.4 Air pockets

Mark 1-2 moments of deliberate silence in the script itself. Ours: the receipt drop at 0:09 (one clean beat of nothing before the paper lands) and 0:48.5 → end (the last 6 seconds carry no voiceover, just the sticker storm and the music resolving). The pauses are what make the loud moments loud.

2.5 Sync notes

At the bottom of the script, write which words must land on which frames, these are contracts between the writer and everyone downstream:

Sync notes: 'Show it.' lands on the squash-on-impact frame (~0:09.3);
'Even the ink...' lands as the scan beam pauses on SHARP CHEDDAR (~0:16.4);
'...their own link' lands on the WhatsApp press (~0:38.9);
silence from 0:48.5 to 0:54.3 for the sticker storm and music resolve.
Step 3

Make your real UI renderable standalone

Your app components assume a running app, routers, auth, data fetching, env vars, a database. The demo needs them to render from a static folder with none of that. This step is where most of the invisible work lives.

3.1 Two paths

Path A, sync into a design tool. We synced the monorepo into Claude Design (/design-sync), which bundles components into a browsable design system with an animation editor over the real code. Path B, vendor a bundle yourself. Build components + CSS + tokens + fonts into one static bundle (esbuild) and commit the snapshot next to the demo, with a refresh script. We ended up doing both: authored in the tool, then vendored the runtime into demo/ds/ so the demo outlives the tool.

3.2 The gotchas, so they don't cost you a day each

Whatever you fork or configure to make this work, write it down in a NOTES file in the repo, including the re-sync risks ("if layout.tsx renames the font variables, all typography silently breaks"). Six weeks later, that file is the only reason a re-sync takes minutes instead of a day.
Step 4

Author the demo as code, on one clock

The single most important architectural decision: the whole demo is one React tree rendered as a pure function of an authored clock T. No GUI timelines, no keyframes in a tool, a function from seconds to pixels.

4.1 The scene table becomes the master cue table

// index.html, one JSON literal drives everything
OM_SCENES = [
  { name: "ColdOpen",     secs: 6   },
  { name: "TheDrop",      secs: 5.5 },
  { name: "MachineReads", secs: 8   },
  { name: "Witness",      secs: 11  },
  { name: "AddsUp",       secs: 12  },
  { name: "TheStamp",     secs: 11.8},
]   // total: 54.3s

Scene code keys off derived offsets (CUES.Witness + 2.1), never absolute times. Retiming a scene is editing one number; everything after it follows.

4.2 The seek contract

The engine listens for a synchronous seek event that commits via flushSync in the same task, an external driver can say "show me exactly this frame" and the DOM is that frame when the call returns:

el.dispatchEvent(new CustomEvent('data-om-seek-to-time-frame', {
  detail: { time: 36.98, sync: true }   // flushSync commit; every seek pauses the internal clock
}))

This contract is what makes flawless recording (step 5) and self-scoring sound (step 7) possible. Determinism is the feature: ask for T = 36.98 twice, get identical pixels twice.

4.3 Motion rules that read as confidence

Nothing fades. Everything stamps, slides, rips, or snaps. Fades read as apology; physical motion reads as conviction. Easing is allowed in exactly three shared helpers and nowhere else, so the whole film moves with one accent.

Build a small kit of instruments and compose scenes from those, the way the soundtrack is composed from a few sounds. Ours: stamp-in, slide, flip, Ticker, Sticker, Badge, animated cursors, CaptionStamp, tape-wipe, paper-tear, and scan-beam wipes.

4.4 Fixtures are the honesty layer

The data tables (items, prices, people) live at the top of the scene file, and there's a standing rule in the README: fixtures must match the sample receipt photo, prices are the printed ones, the total is 84.20. When someone later "improves" a price for visual balance, the rule catches it in review.

4.5 Styling real components inside the film

The demo overrides component CSS by targeting the hashed class names from the vendored bundle (.new_drop, .review_fields…). Those names are stable across rebuilds unless a source CSS module is renamed, so after every design-system refresh, run the smoke render (step 5) and eyeball four frames before trusting a full run.

4.6 The caption layer is part of the composition

Captions render as styled stamp-cards inside the film (same type, same motion), guarded by one flag:

function CaptionStamp(...) {
  if (window.__NO_CAPTIONS) return null;   // the recorder sets this for the clean master
  ...
}
Step 5

Record frame-by-frame, never screen-record

Screen-recording live playback inherits every skipped requestAnimationFrame, that's the stutter you can't edit out. Instead, drive the seek contract: for each output frame, seek to its timestamp, screenshot, repeat. A slow frame costs render time, never a dropped frame.

// record.mjs (full script in /templates), the core loop
for (let f = 0; f <= frames; f++) {
  const t = Math.min(f / FPS, duration - 1e-4);
  await page.evaluate((time) => {
    const el = document.querySelector('[data-om-exportable-video-with-duration-secs]');
    el.dispatchEvent(new CustomEvent('data-om-seek-to-time-frame',
      { detail: { time, sync: true } }));
    // Pin CSS keyframe animations to the authored clock, they run on
    // wall-clock time and race ahead under slow capture otherwise.
    for (const a of document.getAnimations()) {
      try { a.pause(); a.currentTime = time * 1000; } catch { /* detached */ }
    }
  }, t);
  await stage.screenshot({ path: `f${String(f).padStart(5,'0')}.png` });
}

The document.getAnimations() pinning is the non-obvious part. Our loading spinner is a CSS keyframe animation; CSS animations ignore your seek clock entirely and run on wall-clock time, so under slow per-frame capture the spinner spun ~11× too fast in the output. Pause every animation and set its currentTime to the authored clock on every frame.

5.1 The rig around the loop

5.2 Encode

ffmpeg -framerate 60 -i frames/f%05d.png \
  -vf scale=2560:1440:flags=lanczos \
  -c:v libx264 -preset slow -crf 12 -pix_fmt yuv420p \
  -movflags +faststart demo-1440p60.mp4

CRF 12 is visually lossless for UI content, this file is a master, meant to survive a re-encode by an editor and another by every platform. yuv420p + faststart keep it playable everywhere. A full 54s render at 60fps is ~3,260 PNGs and ~10 minutes; drafts go faster with --fps 30.

Step 6

Captions and AI voiceover

6.1 Captions are a projection, not a transcription

The composition already knows every line and time (the caption table in the scene file). SRT and VTT files are projections of that table, same cue times, sentence-case text, kept in sync by convention and checked in review. Never transcribe your own video.

6.2 The VO script format

One line per beat, timecode first, delivery direction at the top, sync notes at the bottom (see Appendix A for the full real script). If your voice tool supports tags, use them for control instead of hoping: pause tags (<#0.4#>-style) to hit timecodes exactly, emotion tags per line, sound-word tags where supported.

6.3 Fixing a slow, flat voice clone

Cloned voices commonly come out with correct pitch but sluggish, under-expressive delivery. What works, in order of impact:

  1. Split long sentences into short fragments. TTS engines phrase fragments with more energy. "Every line. Every price." reads with punch; the same words in one sentence sag.
  2. Raise the speed setting slightly (1.05-1.15) rather than regenerating endlessly.
  3. Put the emotion tag on the fragment, not the paragraph, engines average a paragraph-level tag into mush.
  4. Generate line-by-line, not the whole script in one pass, so one bad read doesn't force a full redo and each line can be nudged onto its timecode in the editor.

6.4 Previewing captions before shipping

To check the SRT against the clean master without an editor: a one-page HTML file with a <video> tag and <track kind="captions" src="demo.srt"> (convert to VTT for browsers), styled with ::cue to approximate the burned look. Two minutes to build, catches every off-by-one cue.

6.5 Distribution

Ship captions as a sidecar (upload the SRT wherever the video is posted, platform CC renders in the viewer's style) and keep the burned-in master for platforms that re-style captions poorly. If you later prepend an intro (step 9), shift the SRT by the intro's length, one small script, in Appendix C.

Step 7

Sound design: make the demo score itself

Sound is where demos most often turn amateur. Our first pass was 58 hand-placed synth blips, it sounded like a slot machine and got the only piece of feedback that matters: "no sound effects are better than harsh and forceful sound effects." We deleted all of it and rebuilt on these rules:

No sound beats a forced sound. One sound per story turn, a 54-second film needs about 10 cues, not 58. First ask if the moment needs sound at all; never repeat the same sound back-to-back.

7.1 Two traps in AI-generated SFX

  1. They pad silence before the hit. Our big-stamp's actual impact is 0.35s into the file; the whoosh peaks at 1.15s. Play the file at the cue time and every hit lands a third of a second late, which reads as "cheap" without anyone knowing why. Measure each file's peak-energy offset once, store it next to the file, and have every player subtract it.
  2. They're mastered quiet. Our stamp peaked at −9.6 dBFS. Set it to "−8 dB" in an editor and it actually plays at −17.6, buried under any music bed. Peak-normalize each file at mix time so your cue levels mean what they say.

7.2 The self-scoring architecture

Don't place sounds in an editor, put the cues in the composition, as data. One file is the single source of sound truth:

// sfx-cues.json (the real one, all 10 cues in Appendix A)
{
  "sounds": {
    "big-stamp":   { "file": "../sfx/big-stamp.mp3",   "hit": 0.35 },
    "page-whoosh": { "file": "../sfx/page-whoosh.mp3", "hit": 1.15 },
    ...
  },
  "cues": [
    { "t": 8.26,  "sound": "paper-drop", "db": -10, "why": "receipt lands, squash-on-impact" },
    { "t": 36.98, "sound": "big-stamp",  "db": -8,  "why": "ADDS UP., the one big hit" },
    ...
  ]
}

Every cue carries a why, that's the review surface. A cue that can't justify itself in one clause gets deleted.

Two consumers read the same file:

  1. A ~40-line WebAudio player (sound.js) so the browser preview is audible while you author. The composition calls window.__SFX_TICK(T) once per rendered frame; the player fires cues the clock crosses, but only during forward playback (0 < dt < 0.25), so seeks and scrubs stay silent.
  2. An ffmpeg mixer (mix-audio.mjs, full script in /templates) that bakes the identical cues onto any export: per-file peak normalization, hit-offset retiming (startAt = cue.t − hit), adelay + volume per cue, one amix with normalize=0, a limiter at 0.95, and padding to the video's length so the container never truncates.

Preview and final can never disagree, and sound survives re-renders with zero editor work: record → encode → mix from a clean checkout is a fully scored master.

Step 8

Music: carve, duck, start at the drop

Step 9

Assemble: intro, transition, export

  1. Founder intro up front (≤5s, camera-real, one sentence). Authenticity before polish is the whole point of the format. Ours is 5.23s. If its aspect ratio doesn't match, decide the letterbox treatment deliberately (scale-to-fill or a branded matte), don't ship accidental black bars.
  2. One branded transition between intro and demo, ours is a tape strip with the product name sweeping across (a position keyframe sweep over ~50 frames at 60fps), with a tape whoosh riding it at −9 dB, cued 3 frames before the visual starts. One transition, used once. Don't let it become a wipe library.
  3. Layer the audio as stems, not as dozens of clips: the VO track, the composition's SFX stem (export the scored demo's audio as one file and lay it in, never re-place individual sounds by hand, they're already frame-exact), and the carved music bed with ducking keyframes. When we replaced four hand-placed SFX clips with the stem, the export gained five cues that had never made it into the editor and every level was suddenly right.
  4. Mind clip-overwrite semantics. Dropping a stem onto a track trims whatever it overlaps (our transition whoosh lost its tail this way). Overlap-check after every placement.
  5. Export H.264, 1440p or 4K, 60fps for the master; then make a ~3.5 Mbps 1080p copy for chats and review links (an 84MB master became a 22MB preview). Shift the SRT by the intro's length for the combined cut (script in Appendix C).
  6. Verify the audio in the file, not in the editor. Probe the exported file at the cue times and confirm the peaks exist (command in Appendix C). Our final check: receipt lands −10.4 dB at 0:13, the ADDS UP stamp is the loudest single moment in the film at 0:42.
Step 10

The ship checklist

  • Under 60 seconds; one claim per scene; six-ish scenes
  • All on-screen data is real and reconciles (totals sum, counts match, tax exists)
  • Composition renders from a static folder with no app running (python3 -m http.server is the whole stack)
  • Recorded frame-by-frame; CSS animations pinned; smoke frames eyeballed before the full render
  • Two masters: captions burned + clean; SRT/VTT sidecars committed
  • VO timed to the frame; sync notes honored; captions match VO word-for-word
  • ≤ 10 sound cues, each with a why; hits measured and frame-exact; nothing repeated back-to-back
  • Music tempo matches the interaction grid; starts at the drop; carved at 250 Hz / 2.8 kHz; swells in the outro
  • Loudness: −14 LUFS, −1 dBTP; the thesis moment is the loudest thing in the film
  • Audio verified in the exported file at cue times, not just in the editor
  • Everything committed: composition, scripts, cues, captions, vendored runtime, NOTES, the demo re-renders and re-scores from a clean checkout with node + playwright + ffmpeg only
Appendix A

The worked example, every real number

The demo this playbook comes from: Vouch, a receipt-splitting app. 54.3s demo + 5.23s founder intro = 59.55s at 2560×1440/60fps.

The full voiceover script

VOUCH, 54.3s PRODUCT DEMO, VOICEOVER SCRIPT
(read deadpan; timecodes are line START times)

[00:00]  Every group chat has one receipt
[00:01]  That starts a war.
[00:06]  Don't argue about the receipt.
[00:09]  Show it.
[00:12]  Vouch reads the paper itself.
[00:14]  Every line. every price.
[00:16]  Even the ink that's barely there.
[00:20]  Your housemates tap what's theirs.
[00:22]  I owe this. not mine. split it.
[00:25]  Every line gets a witness.
[00:31]  When it adds up…
[00:33]  Everyone sees it adds up.
[00:38]  Every friend gets their own link.
[00:40]  One line. zero arguments.
[00:43]  And it keeps the books.
[00:45]  Vouch, three taps, no fights.

The complete cue sheet, 10 sounds scoring 54 seconds

TSoundLevelWhy (verbatim from the cue file)
5.58tape-whoosh−12lime tape wipe into TheDrop
8.26paper-drop−10receipt lands, squash-on-impact
11.03page-whoosh−13paper tear into MachineReads
15.65rubber-stamp−12LOW CONFIDENCE badge stamps
21.70ui-tap−13first claim tap (one establishes the sound)
36.98big-stamp−8ADDS UP., the one big hit
38.90send-swoosh−13WhatsApp send
41.90notification-pop−13thumbs-up lands
42.08tape-whoosh−12pink tape wipe into TheStamp
45.18big-stamp−11THREE TAPS. NO FIGHTS. headline

Measured hit offsets: big-stamp 0.35s, send-swoosh 0.6s, page-whoosh 1.15s, tape-whoosh 0.15s, paper-drop 0.1s. Note what's absent: no sound on 20+ other taps and slides, no success chime (it sat next to the big stamp and diluted it, cut), nothing during the air pockets.

The music numbers

Appendix B

Troubleshooting log, symptom → cause → fix

Every one of these actually happened. Recognize the symptom, skip the diagnosis.

SymptomCauseFix
Recorded video stutters despite a fast machineScreen-recording live playback inherits skipped rAF framesFrame-by-frame: seek + screenshot per frame (step 5)
Spinner spins ~11× too fast in the render onlyCSS keyframe animations run on wall-clock, ignore your seekPin via document.getAnimations() every frame
process is not defined in the component bundleFramework client modules read process.env.* at module scopePrepend a process shim, to every entry point, not just the main one
Database driver appears in the browser bundleA server component's import chain reached the bundlerExclude it; use a client-safe stand-in
All typography silently falls backRuntime-injected font CSS variables undefined outside the appPin the variables in a preview stylesheet; ship the woff2s
Every SFX lands ~0.3s late and reads "cheap"AI-generated SFX pad silence before the hitMeasure per-file peak offset; players subtract it
SFX inaudible under the music bedAI SFX are mastered quiet (ours peaked at −9.6 dBFS)Peak-normalize each file at mix time, then apply cue level
Soundtrack feels like a slot machineToo many cues, synth timbres, repeats in a row≈10 organic cues max, one per story turn, nothing twice in a row
SFX-only mix truncates the videoAudio stream ends at the last sound's tail; -shortest cuts video to matchapad=whole_dur=<video duration> before the limiter
Voice audibly "pumps" the musicDucking alone, too deepEQ-carve 250 Hz / 2.8 kHz first, then duck gently (step 8)
Music takes 15s to get goingTrack trimmed from file start, not from its dropTrim to the drop; land it on a story beat
Overlays drift off the photo's lower rowsFixture coordinates ≠ measured artifact coordinatesMeasure from the actual image (our row pitch: 86px, not 58px)
A sound's tail clicks off abruptly in the editorPlacing a stem overwrote the overlapping clip's tailRe-place the clip over the stem's silent head; overlap-check after placements
volumedetect parsing returns nothingffmpeg prints stats to stderr, not stdoutCapture stderr
Design-tool font scanner chokes on tokensBare math inside clamp() misparsed as a font familyWrap the expression in calc(), rendering-identical
Appendix C

Command reference

Render and encode

npm run smoke           # 4 spot frames, eyeball before a full run
npm run record          # all frames, captions burned (~10 min)
npm run record:clean    # all frames, no captions (VO workflow base)
npm run encode          # frames → visually lossless 1440p60 H.264
node record.mjs --scale 3          # 4K frames
node record.mjs --fps 30           # half-time drafts

Score an export (SFX ± music)

node mix-audio.mjs --video out/demo-nocaptions.mp4                   # SFX only
node mix-audio.mjs --video out/demo-nocaptions.mp4 \
  --bgm music.mp3 --bgm-start 17.9 --bgm-db -21                      # + carved bed

Measure a sound file (loudness + where the hit is)

# peak level (prints to stderr!)
ffmpeg -i big-stamp.mp3 -af volumedetect -f null - 2>&1 | grep max_volume
# find the hit: peak level per 50ms window, the first loud window is the hit
ffprobe -f lavfi -i "amovie=big-stamp.mp3,astats=metadata=1:reset=1" \
  -show_entries frame=pts_time:frame_tags=lavfi.astats.Overall.Peak_level \
  -of csv=p=0 2>/dev/null | head -40

Verify cues exist in the exported file

for t in 13.45 42.15 47.0; do
  ffmpeg -ss $t -t 0.4 -i final.mp4 -af volumedetect -f null - 2>&1 | grep max_volume
done   # expect peaks at cue times, quiet elsewhere

Loudness for delivery

ffmpeg -i final.mp4 -af loudnorm=I=-14:TP=-1:LRA=11:print_format=summary -f null -
# then apply with the measured values in a second (two-pass) run

Shift an SRT after prepending an intro

python3 - <<'EOF'
import re
shift = 5.2333          # intro length in seconds
src = open('demo.srt').read()
def add(m):
    h,mn,s,ms = map(int, m.groups())
    t = h*3600 + mn*60 + s + ms/1000 + shift
    h2=int(t//3600); t-=h2*3600; m2=int(t//60); t-=m2*60
    return f"{h2:02d}:{m2:02d}:{int(t):02d},{round((t-int(t))*1000):03d}"
open('demo-fullcut.srt','w').write(
    re.sub(r'(\d{2}):(\d{2}):(\d{2}),(\d{3})', add, src))
EOF

Small review copy from a big master

ffmpeg -i master-1440p60.mp4 -vf scale=1920:1080:flags=lanczos \
  -c:v libx264 -preset slow -b:v 3300k -maxrate 3800k -bufsize 7600k \
  -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart preview-1080p.mp4
Appendix D

Research sources

The sound and music rules in steps 7-8 were distilled from these, then validated against our own mix:

Plus the standard mix wisdom the numbers here embody: dialogue-first mixing (music 15-20 dB under voice), frequency carving over deep ducking, and −14 LUFS streaming delivery.

stack used React Playwright ffmpeg ElevenLabs voice + SFX any keyframe NLE