Skip to content
Docs / HTML scenes & VideoSpec
Motion

HTML scenes and VideoSpecLive

Two ways for you or a model to write a video that lands as ordinary, editable clips and keyframes. Both are live in 1.0, on their own entries so an app that does not import them pays nothing.

HTML scenesLive

Write an HTML fragment and a stylesheet in a whitelisted subset. validateScene({ html, css }) returns violations that name the supported substitute for everything it refuses. sceneToClip(measuredScene, { fps }) turns a browser-measured scene into one compound clip of native shape, text and image clips with keys, from a one-line data-motion grammar.

Measuring the scene in a browser is the host's step: the package ships no DOM measurer. The subset refuses loudly, which is a feature.

typescript
import { validateScene, sceneToClip } from '@elah/core/html'

VideoSpecLive

A seconds-based JSON document. compileVideoSpec(spec) returns { project, issues } and never throws. buildVideo(authoredSpec) also expands components and polishes, and layProject(engine, project) lays the result onto a live engine as one undo step. specVocabulary() renders the vocabulary for a prompt.

typescript
import { compileVideoSpec, buildVideo, layProject, specVocabulary } from '@elah/core/spec'

Edit operationsLive

Edits an AI can call go through typed ops from @elah/core/ops: sanitizeOps(raw, project) repairs a model's op list and applyOps(engine, ops) applies it as one undo step. See For AI agents.

On this page