Every promo video for my apps is a React project, a JSON file and a build script. The scenes, the narration, the timing and the background music all come out of code, and one command renders the landscape and portrait cuts.

The promo pipeline: script, voice, timeline, render

I run Dhiva Labs as a solo developer, and I ship a lot of apps. Recording a screen and talking over it does not scale to that, and it does not survive a copy change. The pipeline below made the ApiWorkbench video, and I have copied it to the other apps since.

Scenes are React components

The video is built with Remotion, which renders React components to frames. A scene is a component. A transition is a prop. Colours come from one theme file, which I fill from the app's own theme so the video looks like the product. The ApiWorkbench palette in src/theme.ts is the teal-dark theme from the app's lib/theme.dart:

export const C = { bg: '#061012', panel: '#0D1B1E', tealBright: '#2EC8BE', text: '#EAF6F5', 

Fonts live in public/fonts and load from there, because a render that waits on Google Fonts can time out in the middle of a frame.

The narration is one JSON file

Every spoken line is an entry in vo-script.json:

{ "id": "privacy", "say": "No accounts. No analytics. No telemetry. It only sends the requests you make." } 

Change the sentence, run npm run voiceover, and the clip, its duration and its transcript are regenerated. Clips are cached by a hash of the text, voice and lexicon, so only changed lines are regenerated.

An offline voice, and why the first one was dropped

The voice is Kokoro, running locally through sherpa-onnx, with the af_heart speaker. Nothing is sent to a cloud service.

It was not my first choice. My first try used Piper with espeak, and it pronounced "API" as "IPI". For an API client that is disqualifying, and I dropped it. Kokoro gets the acronyms right once you pin them. A pronunciations.txt lexicon sits ahead of the model's own, so my entries win:

api ˌ A p ˌ i ˈ I mqtt ˈ ɛ m k j ˌ u t ˌ i t ˈ i grpc ʤ ˌ i ˌ ɑ ɹ p ˌ i s ˈ i 

Whisper checks every clip

A voice that sounds right to me at midnight is not a test. In the same npm run voiceover step, every generated clip goes through Whisper (the tiny.en model, also through sherpa-onnx), and the transcript is compared with what the script says. A clip is flagged when fewer than 80 percent of its words come back, or when the word "api" goes missing.

That check found two real problems. A list of protocols was being misheard until I added the Oxford comma, so the script now reads "REST, GraphQL, MQTT, WebSockets, server-sent events, and gRPC". And "MQTT" immediately after "WebSockets" was swallowed, so MQTT goes first. Both fixes are visible in the script today.

A frame from the load-test scene

The whine, and the notches

The int8 Kokoro model has a flaw: whenever it speaks, there are pure tones at sampleRate/5 and twice that, which is 4.8 and 9.6 kHz at 24 kHz. I heard an annoying high pitch before I could name it. The fix is in tools/voiceover.cjs:

const deTone = [4800, 4800, 9600, 9600].map((f) => `bandreject=f=${f}:width_type=h:w=${f < 9000 ? 70 : 90}`).join(','); 

Two narrow ffmpeg bandreject notches, each applied twice for depth.

Timing comes from the audio, not from guesses

I never type a scene length. Each clip's duration is measured after the audio is trimmed and normalised, and src/timeline.ts lays out the scenes from those numbers. A scene is as long as its narration plus a lead and a tail that keep it clear of the transitions. One scene is marked fill, and it absorbs whatever is left, so every cut is exactly 90 seconds:

export const FPS = 30; export const TOTAL = 90 * FPS; 

Animations sync to words, not to frame numbers. Inside a scene, cue('word') returns the frame where that word is spoken:

const errorAt = rage ? cue('just') : 0; 

The error banner appears on the word, and if I rewrite the sentence, it moves with it. If the words change so that the cue word is gone, the build throws, instead of rendering a mistimed video.

Why the music is composed by a script

This is the part I learned the hard way. I used a stock track from a "free" music library under one of my ApiWorkbench Shorts, and the video was blocked worldwide by a Content ID claim.

So now the music is original. tools/compose.cjs synthesises it from scratch, with no samples: band-limited sawtooth pads, Karplus-Strong plucks, bass and light drums over a four-chord loop, with a Schroeder reverb and kick ducking. The noise is seeded, so every run produces an identical track:

// Deterministic noise so every render of the track is identical. let seed = 12345; 

Nobody can claim a track that does not exist anywhere else. It also lives in the repo, so a new cut never needs a licence check.

One command

The loop is: edit vo-script.json or the scene definitions, run npm run voiceover, run npm run stills for contact sheets to review, then render everything:

npm run render:all 

That renders the Problem Stack and Rage Hook cuts, each in landscape and portrait, with --crf=17. Portrait is its own composition, not a crop of the landscape one.

What I would copy first

If you want to build this, start in this order: the narration JSON, then the Whisper check, then timing from clip lengths. Those three remove most of the hand-editing. The music script is the last piece, and the one I would have written first if I had known about Content ID.

I wrote this with help from an AI assistant and checked every claim and code excerpt against the source.