Skip to content

Script-to-Beats Compiler for continuous video episodes #6225

Description

@atomantic

Context

Part of the continuous-video-episode feature (see parent epic). PortOS has low-level chunk stitching (server/services/videoGen/chainedVideo.js) but no compiler that turns a script into beat-level video clip specs with byte-stable descriptors.

Scope

Add server/lib/scriptVideoCompiler.js:

  • Ingest scene scripts and partition dialogue/actions into discrete beats (<=35 words, <=2 speakers each).
  • Calculate clip duration from spoken word count (~2.5 words/sec + 1.5s air) snapped to target frame rates (24fps / 17n+5).
  • Inject byte-stable "Bible" slot descriptors for cast (build + hair + age + one color accent), locations (visual + ambience), and style into every clip prompt — the descriptor text must be byte-identical across beats referencing the same cast/location/style entry.
  • Format dialogue into explicit speaker clauses: S1 (Speaker, voice): "...".
  • Enforce a maximum chain length (<=6 clips) before mandating a fresh re-establish (fresh cut type on the clip after the limit).

Pure module, no I/O — takes a script + a bible object, returns an array of beat/clip specs. No route or UI wiring in this slice.

Acceptance criteria

  • server/lib/scriptVideoCompiler.js exports a compiler function with the beat-partitioning, duration-snapping, bible-injection, and chain-length rules above.
  • Unit tests cover: beat splitting on speaker/word-count boundaries, duration calc + frame-rate snapping, byte-identical bible descriptor reuse across beats, dialogue speaker-clause formatting, and the >6-clip fresh-cut trigger.
  • New module registered in server/lib/index.js barrel + server/lib/README.md per the module-organization convention in AGENTS.md.

Files

  • server/lib/scriptVideoCompiler.js (new)
  • server/lib/index.js, server/lib/README.md

Part of #6217


When this ships, check its box in the "Decomposed into" list on #6217. If it was the LAST open child, close #6217 with a summarizing comment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:mediaarea:pipelineComic/story production pipelineeffort:highDispatch reasoning effort: highmodel:heavyDispatch capability: strongest available coding modelplanTracked by /do:replanplanner:sonnet-5Plan authored by the sonnet-5 model

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions