motion-studio

Lesson 1 of 8

Code → frames

Core idea. Claude Opus 5.5 can't output video. It writes a program, and a headless browser plus ffmpeg turn that program into frames. The program exposes one function, window.seek(t), which paints the exact frame for time t and remembers nothing between calls.

The six enemies of determinism

EnemyExampleFix
Wall-clock timerequestAnimationFrame, setTimeout, Date.now(), CSS transitionsDerive everything from t
Carried statex += 3 every frameCompute x from t
Unseeded randomnessMath.random()Seeded PRNG (mulberry32) created inside the draw call
Float accumulationt += 1/60t = frameIndex / fps
Assets not loadedFonts still loading at frame 0document.fonts.load() for each face, then fonts.ready
EnvironmentDifferent GPU, OS or browserPinned Chromium and fixed rendering flags

Fact-check of the article

  • ✅ Opus 5.5 was released 22 Sep 2026. It accepts text, images and PDFs and outputs text, with no video or audio input. "Show it a video" therefore means extracting frames.
  • ⚠️ "Every video is a program": not all of them. One featured music video used a video model for base shots and traced over them in code.
  • ⚠️ "Called through eval": Playwright's page.evaluate runs code over the DevTools protocol, not JavaScript eval().
  • ❓ "Opus skips Remotion/HyperFrames even when installed" is one user's observation. If you want a framework, name it.
  • 💬 "The prompt is 10%, the harness is 90%" is a heuristic, but directionally right.

Second strategy (not in the article). Instead of a pure seek(t), you can seek an animation engine (WAAPI currentTime, GSAP seek) or fake the browser clock. HyperFrames works this way.

Sources for this lesson are in the references. The lesson’s source file is docs/course/01-code-to-frames.md.

Check your understanding.

Quiz

0 of 3 answered
1. What does a film’s window.seek(t) have to do?
2. Which inputs does Claude Opus 5.5 accept?
3. What fixes float accumulation such as t += 1/60?

Flashcards

1 of 3