Mirasphere Studio — AI voiceover video pipeline
- Role
- Sole developer, end to end — an in-house product at Mirasphere Digital
- Client
- Mirasphere Digital, as its own product rather than for a client
- Year
- 2026
Stack
Each choice with the reason for it.
Next.js
frameworkThe authoring surface is a wizard over structured beats, and the live preview has to cost nothing — no API calls until a render is actually requested. Server rendering plus local state gets that for free.
TypeScript
languageA render is a chain of paid third-party calls whose outputs feed each other. Types on the shape of each checkpoint are what stop a malformed intermediate result becoming a re-billed step.
Remotion
toolingVideo as React components means the timeline can be driven by data — real word-level timestamps — rather than hand-placed in an editor. Four compositions produce six output styles because of it.
ElevenLabs
aiNarration in a cloned voice, and Scribe for speech-to-text on the audio it just produced. Getting both from one vendor kept the timing round-trip short.
Kling
aiImage-to-video is what turns a single still photo into a presenter. It is also the slowest and most expensive step in the chain, which is why it checkpoints.
ffmpeg
toolingPing-pong looping a short presenter clip to narration length, and general muxing. The alternative is paying an API for footage that ffmpeg can synthesise from what already exists.
Prisma
toolingThe job queue is database-polled, and each paid step writes a checkpoint row. That table is the entire reliability story — retries read it to know what has already been paid for.
01 · Context
A short marketing video normally needs an editor, a voice artist and days of turnaround, which puts it out of reach for exactly the work that needs it most — many small variations rather than one polished film.
02 · Problem
Make video production a form submission: script in, finished voiceover video out — including a lip-synced AI presenter.
03 · Constraints
What was fixed before the work started, and what each constraint ruled out.
- Third-party AI APIs bill per call — retries must never re-bill a completed step
- Captions and scene changes must land on the narration to the word
- Local-first: no S3, no Redis, no render farm
04 · Approach
An orchestration pipeline where every paid step — text-to-speech, speech-to-text, image-to-video, lip-sync — checkpoints its output, and Remotion’s timeline is driven by real word-level timestamps taken from the narration rather than estimated from a words-per-minute figure. The pipeline assumes third-party APIs will be slow and flaky, and is built so that being slow and flaky costs nothing.
05 · Architecture
Each component, why it beat the alternative, and where it gives way first.
01Beats editor
Next.js wizard- Purpose
- Turns a script into structured beats with a live preview.
- Why this, not the obvious alternative
- Structured beats are what the timeline consumes later, and previewing them costs no API calls — so iteration on the script is free.
Connects to- Voice · Beats
02Voice
ElevenLabs TTS + cloned voice- Purpose
- Generates the narration audio.
- Why this, not the obvious alternative
- A cloned voice makes the output personal rather than generic, and narration is the asset everything else in the timeline is measured against.
Connects to- Timing · Narration audio
03Timing
ElevenLabs Scribe STT- Purpose
- Extracts word-level timestamps from the narration that was just generated.
- Why this, not the obvious alternative
- Transcribing your own synthesised audio sounds redundant until you need to know exactly when each word starts. Estimation cannot give you that.
Connects to- Presenter · Word timestamps
04Presenter
Kling image-to-video + Latent Sync- Purpose
- Turns a still photo into a lip-synced presenter, looped to narration length.
- Why this, not the obvious alternative
- ffmpeg ping-pong loops extend a short generated clip to the length the narration needs, instead of paying to generate more footage.
What breaks firstThis is the step that dominates wall-clock — the presenter render polls for roughly an hour — so it is where a job is most likely to be interrupted, and it is the most expensive thing to lose. The checkpoint is what makes that survivable rather than a re-bill.
Connects to- Render · Presenter footage
05Render
Remotion CLI worker- Purpose
- Composes the final video from beats, audio and presenter footage.
- Why this, not the obvious alternative
- Audio-driven durations with largest-remainder rounding, so proportional scaling of beat lengths never loses or duplicates a frame.
Connects to- Jobs · Checkpoints
06Jobs
Prisma + database-polled queue- Purpose
- Sequences the pipeline and records a checkpoint per completed step.
- Why this, not the obvious alternative
- A polled table is the simplest queue that satisfies "no Redis", and checkpoints mean a retry resumes instead of restarting.
06 · Implementation
The wizard captures a script as structured beats and previews them without touching an API, so writing is free and only rendering costs money. A render then walks a fixed chain: ElevenLabs generates narration in a cloned voice, Scribe transcribes that same audio back to word-level timestamps, Kling turns a still photo into presenter footage, Latent Sync applies lip-sync, and ffmpeg ping-pong loops the clip to narration length. Remotion composes the result from four compositions that produce six output styles, with beat durations scaled proportionally against the real audio length and largest-remainder rounding so the frame count always reconciles. Every one of those steps writes a checkpoint row through Prisma before the next begins, which is the difference between a flaky vendor costing a retry and costing the whole video — the presenter step alone polls for around an hour. The whole thing is local-first: no S3, no Redis, no render farm, and the Claude-powered convenience features self-disable when no key is present rather than failing the pipeline.
07 · Challenges
What resisted, with the specific symptoms.
- Challenge 01Third-party render polling dominates wall-clock — the presenter step takes around an hour, and anything that interrupted it lost the money as well as the time
- Challenge 02Audio duration and the visual timeline disagreed, so captions and scene cuts drifted off the narration
- Challenge 03The lip-sync API required publicly reachable URLs, and the constraint was no object storage
08 · Solution
The long-poll problem was solved by checkpointing every paid step, so a retry resumes from the last completed one and a failure costs nothing extra. The timeline mismatch was solved by driving durations from the audio: proportional scaling of beat lengths with largest-remainder rounding, so the frame counts reconcile exactly and captions land on the word. The public-URL requirement was solved without buying storage, keeping the local-first constraint intact.
09 · Results
The outcome in the client’s terms, then any measurement, with its source and date.
It works end to end: a script becomes a branded 30-second video in around eight minutes, including cloned-voice presenter videos built from a single still photo, with the core path consuming zero LLM credits.
- Wall-clock for a branded 30-second video
~8 minutes
- Source
- Self-measured
- Captured
Self-measured: my own measurement under my own conditions, not independently verified. Treat it as an indication, not evidence.
- Output styles from 4 Remotion compositions
6
- Source
- Self-measured
- Captured
Self-measured: my own measurement under my own conditions, not independently verified. Treat it as an indication, not evidence.
- TypeScript in the pipeline
~5,300 lines
- Source
- Self-measured
- Captured
Self-measured: my own measurement under my own conditions, not independently verified. Treat it as an indication, not evidence.
10 · Reflection
What I would do differently now, and why.
Checkpoint-everything was the best call in the codebase — it turned a chain of flaky, per-call-billed third-party APIs into a pipeline that can be retried without thinking about it. The next moves are structural rather than clever: renders belong on a queue-fed worker box rather than the app host, and the 9:16 remix flow is the output people ask for most.