Open Editor
← all case studies

case 06

Highlight Clips

Mark the ranges once. Render once. Get one clip per range.

// the problem

A four-hour recording — a stream, a match, a conference day, a long interview — and a list of moments worth keeping. The job is mechanical: cut each marked range into its own clip, audio intact, names you can find later. It’s also the job that eats an evening, because the mechanical part is spread across dozens of hand-typed commands.

// how everyone solves it

ffmpeg -ss 00:12:31 -to 00:13:04 -i stream.mp4 -c copy clip01.mp4
ffmpeg -ss 00:47:19 -to 00:48:02 -i stream.mp4 -c copy clip02.mp4
ffmpeg -ss 01:22:45 -to 01:23:31 -i stream.mp4 ...   # ×46 more

One command per clip, and every command a chance to drift: -c copy snaps to keyframes so cuts land early or late; switch to re-encoding and now each invocation carries its own quality settings; the filename numbering is yours to keep straight; and when clip 31 of 48 fails, the loop either dies or lies. Everyone who does this regularly ends up maintaining a private script with the same ten fixes in it.

// the m0saic program

@m0saic/media/highlights/v1 takes the recording and the marked ranges as one declaration and renders the whole set in one pass: one clip per range, audio intact, mp4 or webm, deterministic names from your labels. The range list is data, not a command history — check it into the project, re-render it tomorrow, get the same clips.

render pendingA real batch-cut demo for this spot is being prepared from the template's preview renders.
one long recording in, a labeled clip set out — a single render

// run it yourself

One command, straight from a terminal. The CLI carries the template, the engine, and the validator — if the layout can’t render correctly, it fails before a single frame is written.

npx m0saic make @m0saic/media/highlights/v1 --inputs stream.mp4 -o clips.mp4

// read the source

The template behind this study is @m0saic/media/highlights/v1 — a typed, unit-tested program, not a script. The template library is headed for open release; the m0saic source lives on GitHub.