Motion Lab — a code-based video engine
Personal project · 2026 · Node.js
My engine for animated videos in code. Headless Chrome paints each frame, WebGL2 adds film-like effects, FFmpeg encodes. Directed with Claude Code.
This is the tool I use to create the videos for my channels. Instead of dragging clips around a timeline by hand, every video is made with code.
The idea #
Each frame depends only on the moment in the video where it sits. Chrome, running without a window (headless), draws each frame using the graphics card. Then a series of WebGL2 effects gives it a light and film look (light rays, haze, dust, smoke, glow, halation, ACES tone mapping, color grading and grain), and the frames go straight into FFmpeg, which assembles the final video. Honestly, seeing a film look come out of a web browser still surprises me.
How I use it #
I open the project in Claude Code and describe the video I want. The model works with a library of tested building blocks (each with its own moving demo) and follows a studio process that pauses at six points for my approval: the brief and assets, the style guide and shot list, still images, the rough cut, fixes for the three worst defects a reviewer finds, and finally sound, versions in different formats, and the poster.
- One scene can be rendered in different formats (Shorts, YouTube, and so on).
- Contact sheets, frame strips and quality checks let the model actually see the motion before the final render.
- A studio in the browser, laid out like a video editor, to move through the timeline, shots, narration and sound in sync.
- Every MP4 is checked after it’s generated; if it doesn’t match what the scene called for, the render fails.
Why it matters to me #
The model no longer starts each video from a blank chat: it starts from a base that already looks good. That’s the whole point.
Technologies
- Node.js
- Headless Chrome
- WebGL2
- FFmpeg
- Claude Code