Many Takes, One Composition

A composition is a list of references, not a baked video: each clip keeps its resolution, crop, padding, chrome and background, while annotations and zoom live on the shared timeline.

The request was practical: one demo, recorded in three windows, should become one piece. Concatenation is easy. Keeping each recording’s native pixels, its own crop, its own window chrome and a shared annotation layer is not. The composition became the feature that forced the editor to grow up.

A Reference, Not a Copy

A composition is a library item with the composition kind. It stores references to recordings, not a new media file. The raw takes are never copied, re-encoded or rewritten. Each clip carries a source range, a crop, and a frame recipe: background, colour, padding, radius, chrome, shadow and title.

That decision keeps deletion honest. If a source recording disappears, the composition does not silently lose a section or bake in a stale copy. The editor names the missing clip, playback skips it, and the only repair offered is to remove it. A composition that pretends a missing file still exists is worse than one that says so.

Native Pixels on a Shared Canvas

The canvas is the largest cropped recording. A 960×540 clip inside a 1920×1080 composition keeps its 960×540 pixels and sits centred on its own background. It is not stretched to fill the frame, and it does not inherit the neighbour’s resolution.

The background is not a fixed colour. Roughcast samples four frames from the clip, averages them, and darkens the result for contrast. A green terminal gets a green-black backdrop; a light slide deck gets a quieter one. The sample is stored per clip, so the backdrop survives a reload and can be replaced with a solid colour or a gradient.

Window chrome follows the clip, not the canvas. A 540p window gets a smaller title bar and smaller traffic lights than a 1080p window, because the chrome belongs to that recording. Crop, padding and corner radius are entered in pixels. A five-pixel radius at 1080p means five pixels, not five percent of whatever the canvas happens to be.

The Frame Can Grow

Not every composition wants the aspect of its largest clip. The Canvas inspector offers Auto, 16:9, 9:16, 4:3, 3:2, 1:1 and 21:9. A fixed aspect extends the background around the native content box instead of stretching the content into it. A square recording in a 16:9 composition becomes a square window on a wide stage.

Annotations and zoom are attached to that content box, not to the expanded canvas. Changing the aspect moves the stage, not the explanation. A text label stays over the terminal it describes, and a zoom focus keeps the same point in the recording. That distinction is easy to miss until the first aspect change moves every label into the background.

One Editor, Not Two

The first composition page had its own preview, its own clip inspector and no annotations. That was a second editor with a smaller toolbox, and it showed. The composition now opens in the same full-screen editor as a take: clips and elements share the left rail, the right inspector edits the selected clip or annotation, and the bottom timeline is the same.

The editing layer is stored under edit in the composition project. It is the same TakeProject a recording uses: trim, zoom, text, shapes, click rings, redactions, highlighter, freezes, speed ranges, placeholders and cut-out markers. The clips sit underneath. The composition canvas never scrolls; the page itself is fixed, and the panels manage their own overflow.

Two details make the shared editor behave like one product rather than two code paths. Undo/redo snapshots both the edit layer and the clip list, so adding or trimming a clip is undoable. Zoom applies the same transform to the clip window and the annotations; the first implementation reset the canvas transform inside the clip renderer, which zoomed the labels but not the video. Redactions are clipped to the active clip body, so they hide the recording, not the background around it.

The File Still Has to Exist

A composition that only plays inside Roughcast is a project, not a result. Export renders the same canvas in real time and sends the WebM to the local server. MP4 is H.264, WebM is VP9, and both go through the same ffmpeg finish as a take. Cut-out markers are applied after the target render, so they shorten the file without changing the timeline.

The Size control offers 1080p and Native. 1080p fits the composition into a 1920×1080 box; a 16:9 composition whose native pixels are 3412×1920 becomes roughly 1918×1080. Native keeps the full canvas. The export uses the same composition renderer as the preview, including per-clip padding at the scaled size, so the file is not a second implementation with its own bugs.

The Metadata Was Lying

A square Kitty window exposed an older assumption. The capture settings reported 1920×1080, but the encoded frames were 1000×1000. The editor trusted the metadata first and drew a 16:9 canvas with a stretched square video. The video element knew better.

The encoded frame is now the authority. The editor reads videoWidth and videoHeight after metadata, the recorder stores the stream dimensions instead of the track settings, and compositions correct source metadata when the videos load. A square recording stays square in the editor, the composition preview and the export. The same fix reached the recorder preview and the library covers: show the whole frame, not a cropped idea of it.

What a Composition Is Not

It is not a multi-track editor. One clip plays at a time; there are no transitions, overlays across parallel tracks or per-clip audio. It is not a new source file until Export is pressed. Audio and camera are still out of scope, and the system cursor is still part of the captured pixels.

The honest boundary is the useful one: a composition is a sequence of recordings with one shared explanation layer. It does not need to become a non-linear editor to make a three-window demo watchable.


A composition is honest when it admits that it is still a set of recordings. The clips keep their pixels, the background belongs to each clip, and the annotations belong to the whole. The result is not a flattened file pretending to be a source; it is an edit that knows what it references.

AI Insights: A Composition Is an Edit, Not a Copy
Source Code: MPL-2.0 · Content: CC BY-SA 4.0 · Credits & AI Disclosure