· via dev.to (home feed)
Miraiclip launches as MIT-licensed open-source engine for browser video editors
Miraiclip is a new MIT-licensed engine for building video editors in the browser: a headless, command-driven core with WebCodecs-based rendering and exports that match the preview.

A new open-source project called Miraiclip has arrived on npm under the MIT license, positioning itself as the missing engine layer for browser-based video editing. According to a dev.to post by the project's author, it is deliberately a library rather than an application: there is no timeline UI and no buttons. The core is headless, holding project state, a timeline measured in microseconds and a complete command history, with rendering delivered as a separate layer. The core carries zero UI dependencies, so teams can build their interface in React, Vue, Svelte or plain JavaScript.
A command-driven core
The author describes one design decision the whole engine hangs on: state changes happen by dispatching descriptive commands, not by calling imperative methods that mutate state directly. Every command is deterministic, validated against a schema, serializable and invertible, and several commands can be grouped into a single transaction that undoes as one step.
Three capabilities follow from that choice. Undo and redo work exactly because commands can be inverted, producing a history that is replayable and inspectable. Collaboration becomes tractable because each state change is emitted as fine-grained JSON patches following RFC 6902, which the author presents as the substrate for multiplayer editing. And AI control comes nearly for free: the command catalog is published with JSON schemas, so an LLM can read project state and generate valid edit sequences. A human clicking a UI, a model planning an edit and a sync layer replaying a collaborator's changes all speak the same command language.
Rendering and export
The rendering package pairs a WebCodecs decode pipeline with a WebGL compositor built on PixiJS and an audio-master clock. Exports run through the same compositor as the preview, so the output matches what users saw by design rather than by fortunate coincidence. Output formats are MP4 and WebM, and encoded video can stream straight into a file via showSaveFilePicker so long projects do not accumulate in memory.
A third package runs the identical pipeline in headless Chrome driven from Node, exposed through a command-line tool for offline export. On the features side, the engine ships keyframe animation with cubic-bézier easing, effects including color adjustment, blur and chroma key, transitions with equal-power audio crossfades, and karaoke-style captions importing SRT, VTT and ASR word-level timestamps — all rendered identically in preview, browser export and server export.
Engineering lessons worth stealing
The post also documents three problems the browser forced the author to solve. First, frame accuracy has to be judged on presented frames, not merely scheduled ones: Miraiclip's test fixtures encode each frame's index as its color so assertions read actual canvas pixels, an approach that caught seek and playback bugs callback-based tests would have passed.
Second, export memory must stay independent of timeline length. The author reports that mixing an hour of audio in a single buffer costs roughly 1.4 GB, so the engine instead mixes audio in bounded sequential chunks interleaved with the frame walk and streams encoded output to disk. A demonstrated one-hour export covering 86,400 frames plus a full hour of audio peaked at 165 MB of JS heap and ran at 1.6x realtime on a development laptop.
Third, nothing is trusted that cannot be verified by a second decoder. A corpus re-decodes every exported file with ffmpeg, checking each frame's timestamp and pixels, audio gain and A/V sync; the measured offset was 0 ms at both ends of the file.
Status
Miraiclip is pre-1.0. The author says the core model is stable in shape but warns that API changes should be expected between minor versions, and is explicitly asking for feedback on the API before it hardens. Three packages exist so far: @miraiclip/core, @miraiclip/renderer and @miraiclip/server-export. Rendering and export target Chromium-family browsers because of the WebCodecs dependency, while the core runs anywhere JavaScript does, including Node. The code is hosted on GitHub under the comaniacs organization, with documentation and live examples where the code shown is the code that runs.
Why it matters
Teams building in-browser editors have historically rebuilt the same engine-level machinery — precise playback, an undo system that never corrupts state, exports faithful to the preview — because no reusable engine existed. An MIT-licensed, framework-agnostic package that solves those problems once shifts the effort back to product work. The command-plus-schema design is also well timed for AI-assisted editing: if a model can dispatch the same commands as a human, a single engine serves both. The caveats are real, from pre-1.0 APIs to Chromium-only rendering, but the browser-side video engineering documented alongside the code is instructive even for teams that never adopt it.
- #open-source
- #video-editing
- #webcodecs
- #javascript
- #browser