Skip to content

Open source CapCut alternative.

TypeScript

docs(cut): scene audio is burned-in narration, not a voice spine [rebuild]

David Le5d2b91fb4950
diff --git a/docs/guides/cut/ai-assistant.md b/docs/guides/cut/ai-assistant.md
index e32e60d4..b23420c3 100644
--- a/docs/guides/cut/ai-assistant.md
+++ b/docs/guides/cut/ai-assistant.md
@@ -74,7 +74,7 @@ Tool calls execute in the open tab against the same store the user is editing
## Generating a whole video
-Most generation tools make one asset. `generate_scene` makes a whole cut: it writes a script, voices it, breaks it into shots, and — once the user approves — renders each shot and lays them on the timeline under the narration. It is genre-agnostic; the look comes from the brief and any references. It can also animate audio the project already has (`from_audio_asset_id`), tiling shots over that spine instead of writing a script.
+Most generation tools make one asset. `generate_scene` makes a whole cut: it writes a script, breaks it into shots, and — once the user approves — renders each shot and lays them on the timeline. The video model speaks each shot's line, so the clips carry their own narration; a music bed sits under them. It is genre-agnostic; the look comes from the brief and any references. It can also animate audio the project already has (`from_audio_asset_id`), tiling shots over that spine instead of writing a script.
Because a scene renders many paid shots, the tool plans and then stops. `generate_scene` returns a shot list and waits; `approve_scene` starts the renders; `regenerate_shot` and `restyle_scene` revise afterward; `cancel_scene` kills the active run. The plan the user approves is the plan that renders: voicing runs after the gate and only rescales the approved shots to the real voice lengths (a line longer than one clip splits its shot). The run is browser-side like every generation here, held in a small store beside the panels (`lib/genScene.ts`) so switching tabs never orphans it; leaving the project pauses it, its persisted plan (`ProjectDoc.genvideo`) resumes on the next open, and a run that dies persists as failed so a reload never resumes it. Nothing runs behind the user's back: cancelling, dismissing an unrendered plan, or deleting the chat thread that asked all stop the run and clear its plan — clips already placed stay on the timeline. Progress shows on a card in the chat while the timeline fills on its own. The shots ride under one consistent AI voice with the video model's own audio off; this version has no talking-head lip-sync.
diff --git a/docs/guides/cut/brief-to-video.md b/docs/guides/cut/brief-to-video.md
index f9a7db85..ce7abb9a 100644
--- a/docs/guides/cut/brief-to-video.md
+++ b/docs/guides/cut/brief-to-video.md
@@ -24,16 +24,18 @@ never replanned from scratch to change part of it.
brief
│ script — beats with arc, camera framing, dialogue
▼
+shot plan — the script cut into shots (user approves before money is spent)
+ ▼
style bible — one look + a sheet per character and location
│ (reference images minted once, from the user's references)
▼
-voicing — narration spine + music bed; shots rescale to real lengths
- ▼ (user approves the plan before money is spent)
keyframes — each shot's opening frame, rendered from the sheets
▼
-shots — video seeded from the keyframe, laddered down on failure
+shots — video seeded from the keyframe, laddered down on failure; the
+ │ model speaks the shot's line, so its audio is the narration
▼
-timeline — clips trimmed to their slice under the narration
+timeline — each clip trimmed to its slice, playing its own narration, a
+ music bed underneath
```
The written plan decides *what* every shot is; the render steps decide only
@@ -75,9 +77,9 @@ instead — the same fixed words every shot:
## Where it's going
-Audio follows the same principles later: the narration spine generalizes to a
-music-driven spine with sparse on-screen caption beats instead of wall-to-wall
-narration, and pacing cut to the beat. Longer arcs (multi-scene episodes) are
+Audio follows the same principles later: wall-to-wall narration generalizes to
+a music-driven cut with sparse on-screen caption beats instead, and pacing cut
+to the beat. Longer arcs (multi-scene episodes) are
the same plan data at larger scale — the sheets are what make a cast hold for
thirty minutes, so they, not the shots, are the durable asset. The assistant
already controls the whole editor and the bundled ffmpeg, so every post step —
diff --git a/site/src/cut/lib/genvideo/adapters/index.ts b/site/src/cut/lib/genvideo/adapters/index.ts
index cece4319..46087e6f 100644
--- a/site/src/cut/lib/genvideo/adapters/index.ts
+++ b/site/src/cut/lib/genvideo/adapters/index.ts
@@ -10,11 +10,12 @@
* browser-only generation modules and the node self-test can keep importing the
* fakes from it.
*
- * No `lipSync` role: v1 has no hosted lip-sync, and `video.audioNative` is
- * false, so the orchestrator places each shot as b-roll under a separate
- * narration spine. `music` is always present but best-effort — it degrades to
- * no bed when no music backend is configured. `review` is the dailies check:
- * every take is watched against its plan before it places.
+ * No `lipSync` role: there is no hosted lip-sync, and `video.audioNative` is
+ * false, so a provided-audio scene places each shot as muted b-roll under the
+ * user's spine, while a generated scene lets each shot's burned-in narration
+ * play. `music` is always present but best-effort — it degrades to no bed when
+ * no music backend is configured. `review` is the dailies check: every take is
+ * watched against its plan before it places.
*/
import type { ModelSuite } from "../capabilities";
diff --git a/site/src/cut/lib/genvideo/adapters/media.ts b/site/src/cut/lib/genvideo/adapters/media.ts
index 92497b2a..6fde064c 100644
--- a/site/src/cut/lib/genvideo/adapters/media.ts
+++ b/site/src/cut/lib/genvideo/adapters/media.ts
@@ -8,11 +8,12 @@
* bridge's `importMedia` has nothing left to do.
*
* Two shaping choices matter for the assembled cut:
- * - Video is NOT audio-native here: the model can't lip-sync our narration
- * track, and every shot rides under a separate narration spine. We let the
- * model generate whatever audio it wants and handle it locally — the placed
- * clip is muted, so its audio never competes — rather than asking the model to
- * suppress audio (a knob many models reject, which just fails the render).
+ * - Video is NOT audio-native here: the model renders each shot's audio itself
+ * from the prompt (which states the shot's line), and there is no way to feed
+ * it our own track. In a generated scene that burned-in narration is the point
+ * — the orchestrator places the clip unmuted and lays no separate voice track.
+ * In a provided-audio scene the user's audio is the spine, so the orchestrator
+ * mutes the clip's own audio instead.
* - Cast identity is anchored per shot, strongest signal first (see the ladder
* in shotAttempts.ts): the shot's keyframe — already rendered with the cast's
* reference images, so it IS the cast — seeds the render as its literal
@@ -85,7 +86,8 @@ export function makeImageRole(projectId: string, chatId?: string): ImageRole {
export function makeVideoRole(projectId: string, chatId?: string): VideoRole {
return {
- // The model isn't given our narration track, so it never lip-syncs to it.
+ // The model renders its own audio from the prompt; it takes no audio input,
+ // so it never lip-syncs to an external track.
audioNative: false,
async generate(input) {
// The identity ladder: each rung renders from a weaker identity anchor,
@@ -173,6 +175,9 @@ export function makeVideoRole(projectId: string, chatId?: string): VideoRole {
};
}
+/** The scene voice capability. Retained in the suite and the model-swap
+ * registry, but the current orchestrator no longer places a voice track — a
+ * generated scene's narration is burned into each shot by the video model. */
export function makeVoiceRole(projectId: string, chatId?: string): VoiceRole {
return {
async speak(input) {
diff --git a/site/src/cut/lib/genvideo/types.ts b/site/src/cut/lib/genvideo/types.ts
index 95257849..c97e9807 100644
--- a/site/src/cut/lib/genvideo/types.ts
+++ b/site/src/cut/lib/genvideo/types.ts
@@ -7,11 +7,12 @@
* is the only thing that mutates it, and it re-asserts the coverage invariant
* (`coverage.ts`) after every mutation.
*
- * A run has one audio spine — either audio the user dropped in, or audio the
- * pipeline generates from a brief (a spoken script plus a music bed). Shots
- * tile that spine, and each shot's video is lip-synced to its slice, so the
- * two entry points ("animate this audio" and "make me a video of X") share the
- * same machinery.
+ * A run has one audio spine. In provided mode it is audio the user dropped in:
+ * shots tile it and each shot's video is lip-synced to its slice. In generated
+ * mode the shots ARE the spine — the video model burns each shot's slice of the
+ * scripted line in from the prompt (no separate voice track), a music bed under
+ * it. The two entry points ("animate this audio" and "make me a video of X")
+ * share the planning, coverage, and placement machinery.
*
* Units: the plan reasons in whole frames, never seconds. Frame boundaries are
* integers, so "shot i ends exactly where shot i+1 begins" holds by
@@ -32,7 +33,7 @@ export interface RefAsset {
/** One beat of a generated script — a shot's worth of screen time. */
export interface ScriptBeat {
- dialogue: string; // spoken line (drives the voiceover and the lip-sync)
+ dialogue: string; // spoken line the video model burns into the shot's audio
action: string; // what happens on screen
characters: string[];
location: string;
@@ -82,9 +83,9 @@ export interface Shot {
location: string; // location asset id ("" = unspecified)
framing: string;
startKeyframe?: string; // media asset id
- /** The beat voiceover this shot lip-syncs to (generated mode). The voice is
- * placed once per beat; a shot spans a slice of it (voiceFromSec..voiceToSec,
- * relative to the beat start), so a line longer than one clip is never cut. */
+ /** Legacy: a per-shot voiceover slice from the old generated-mode voice
+ * spine. Generated mode no longer synthesizes a voice (the video burns its
+ * own narration in); these are read only from plans persisted before that. */
voiceAssetId?: string;
voiceFromSec?: number;
voiceToSec?: number;
@@ -101,15 +102,14 @@ export interface Shot {
error?: string;
}
-/** One beat's voiceover placed on the soundtrack — the unit the spine is
- * placed in, so a video regeneration never restacks narration. */
+/** One beat's frame span — the beat→timeline map a re-cut reads to synthesize
+ * the words heard across a range. The voice ids are legacy: generated mode no
+ * longer places a voice spine, so they ride only on plans persisted before the
+ * video model burned each shot's narration in itself. */
export interface BeatVoice {
- /** The voiced clip's asset id. Absent while the plan is still on estimated
- * lengths (pre-approval); set once the beat is voiced. */
voiceAssetId?: string;
startFrame: number;
durationFrames: number;
- /** The placed soundtrack clip id, once on the timeline (idempotent placement). */
voiceClipId?: string;
}
@@ -127,7 +127,7 @@ export interface VideoProject {
/** Provided mode: the dropped audio clip + its asset. */
audioClipId?: string;
audioAssetId?: string;
- /** Generated mode: the written script, the voiced spine, and the music bed. */
+ /** Generated mode: the written script, the beat→frame map, and the music bed. */
script?: ScriptPlan;
beatVoices?: BeatVoice[];
musicAssetId?: string;
diff --git a/site/src/cut/server/ai/catalog.ts b/site/src/cut/server/ai/catalog.ts
index b0d3a61d..51474977 100644
--- a/site/src/cut/server/ai/catalog.ts
+++ b/site/src/cut/server/ai/catalog.ts
@@ -743,12 +743,12 @@ References: users attach images/clips to their message or the generate panels; p
If generation fails with a sign-in or credits message, relay that plainly — generation needs a Donkey sign-in with credits. Write vivid, specific prompts (subject, style, lighting, motion); the user's request is usually shorthand, so flesh it out. A narrated multi-shot production is generate_scene — read the scene-productions skill before planning one, especially from an audio file or in a named style.`,
"scene-productions": `# Scene productions (generate_scene)
-generate_scene plans a narrated multi-shot cut; approve_scene renders it. Planning is free; every shot render spends credits, so present the plan card and wait for the user's go-ahead — never approve on your own. Per shot, the pipeline already guarantees: smooth continuous motion (no stop-motion or held poses), zero on-screen text, character consistency via a style bible plus reference sheets, gapless non-overlapping placement of shots/voice/music, shot audio muted under the audio spine, and a reviewer that retakes failed renders.
+generate_scene plans a narrated multi-shot cut; approve_scene renders it. Planning is free; every shot render spends credits, so present the plan card and wait for the user's go-ahead — never approve on your own. Per shot, the pipeline already guarantees: smooth continuous motion (no stop-motion or held poses), zero on-screen text, character consistency via a style bible plus reference sheets, gapless non-overlapping placement, and a reviewer that retakes failed renders. Audio: a brief-driven scene has NO separate narration track — the video model speaks each shot's line, so the clip plays its own burned-in narration with a soft music bed under it; a from-audio scene mutes the shots as b-roll under the user's spine instead.
Aspect: every shot renders at the plan's aspect, frozen from the project when approved. Check project.aspect first; when the user wants a specific format, set_aspect BEFORE approve_scene. A 9:16 project takes 9:16 shots — pass aspect to a generation tool only to match the project. Changing aspect after approval re-renders nothing.
Look: the user's style reference is the strongest anchor — pass attached images/clips as reference_asset_ids; they anchor the style bible and every shot. A reference contributes the LOOK; when the user wants its pictured character or place in the video itself, say that in the brief — otherwise the pipeline designs a fresh cast in the reference's technique. The brief describes the same look in plain visual traits so words and image agree; with no reference, build the trait wording from the ask (a simple children's cartoon → "flat hand-drawn 2D animation, clean thick outlines, simple rounded characters, soft colors, gentle fluid motion"). Describe any show, franchise, or artist by traits — the generator rejects trademarked names. Name recurring wardrobe and props in the brief so independently rendered shots match.
From an audio file (the audio rides the timeline as the spine): listen_audio first and extract every fact — who speaks, who appears, each topic in order. Then generate_scene with from_audio_asset_id PLUS a brief carrying those facts; the brief outranks transcript mishears. Speech in another language: write the brief's facts in English and pass audio_language so the on-device transcriber uses the right recognizer. Long silence or music in the source becomes filler shots — suggest trimming first (detect_silence); shots tile the full asset length, so warn on long files (many paid shots).
Scope: deliver exactly what was asked — no subtitle tracks, titles, or extra music on top (brief mode lays its own soft music bed; from-audio mode adds none). One scene run at a time — cancel_scene stops the active one when the user wants it gone or replaced.
-After renders land: spot-check with capture_frame or watch_video (aspect, style, motion). The user may point at clips by @ token ("@c2 doesn't match the audio") — the clip attachment's id maps to videoTrack in editor_state, whose sceneShot is the n regenerate_shot takes; carry their complaint as its note, and check the audio itself with listen_audio on the spine asset (subtitles_generate would write a caption track nobody asked for). A shot that failed all its takes holds a still — repair it ONLY with regenerate_shot n (it re-runs the shot's identity ladder and swaps the clip in place); deleting the still or rendering a replacement with generate_video orphans the shot and loses the run's identity anchors and review. Revisions ladder by scope, never a fresh generate_scene (that replans and re-bills the whole video): one shot redone or nudged → regenerate_shot; a section restructured — split, tightened, content added ("the last shot is missing the soccer scene") → recut_scene from_shot..to_shot with the ask as its instruction (replans just that span on the same audio, keeps the cast and every other clip, bills only the new shots, no approval gate — the user's ask is the go-ahead); a whole-look change → restyle_scene (every shot re-renders, confirm first). Undo removes clips; spent credits stay spent.`,
+After renders land: spot-check with capture_frame or watch_video (aspect, style, motion). The user may point at clips by @ token ("@c2 doesn't match the audio") — the clip attachment's id maps to videoTrack in editor_state, whose sceneShot is the n regenerate_shot takes; carry their complaint as its note, and check the audio itself with listen_audio (the spine asset in from-audio mode, or the shot clip's own source in a brief-driven scene, where the narration is burned into each clip) — subtitles_generate would write a caption track nobody asked for. A shot that failed all its takes holds a still — repair it ONLY with regenerate_shot n (it re-runs the shot's identity ladder and swaps the clip in place); deleting the still or rendering a replacement with generate_video orphans the shot and loses the run's identity anchors and review. Revisions ladder by scope, never a fresh generate_scene (that replans and re-bills the whole video): one shot redone or nudged → regenerate_shot; a section restructured — split, tightened, content added ("the last shot is missing the soccer scene") → recut_scene from_shot..to_shot with the ask as its instruction (replans just that span on the same audio, keeps the cast and every other clip, bills only the new shots, no approval gate — the user's ask is the go-ahead); a whole-look change → restyle_scene (every shot re-renders, confirm first). Undo removes clips; spent credits stay spent.`,
"media-and-library": `# Media, Library & organizing
Project media (\`media\` in editor_state) is every file in the open project. The Media panel shows the user's own imports — assets with no origin tag; created media (origin generated, voiceover, stock, chat, freeze, recording) lives where it was made until filed away.