Claude Code rendering a JavaScript animation frame by frame
OpenAIClaudeGoogle AI SearchPerplexity
Ask AI →
TL;DR
You don’t need Remotion, After Effects, or an AI video generator to make motion graphics. Claude Code writes the video as a JavaScript function of time. A headless browser renders every frame, FFmpeg stitches them into an MP4, and Claude checks its own frames and fixes the code. No generator fee, just the coding tool you may already run.

What code-based video with Claude actually is

“AI video” usually means a model that guesses at pixels, one attempt at a time. This is the opposite, and that’s why it’s both free and repeatable. Claude Code doesn’t generate a video at all. It writes the video as code, and code can be read, redrawn, and corrected.

The gap is practical, not academic. A generated clip is a set of guesses you can’t inspect, priced per attempt. A coded video is a description of every frame, priced by usage on a plan you may already have, and stable by construction. Ask for the same frame twice and you get the same picture.

Direct answer
Claude Code doesn’t generate video pixels. It writes the video as a JavaScript function that takes a time value and returns one frame. A headless browser draws each frame, FFmpeg stitches them into a file, and Claude inspects its own frames and corrects the code. You end up with a normal MP4 for the cost of the Claude usage you already pay for.
Watch · 2 minutes
The two ways in
Prompt it, or hand it the skill URL.
1
Prompt Claude Code to build a video as a JavaScript function of time.
A function that takes a time T and returns one frame. That is the entire mental model.
2
Render 30 or 60 frames per second in a headless browser and stitch with FFmpeg.
Playwright draws each frame; FFmpeg assembles them into an MP4.
3
Bring in reference images so the frames match a real style.
References are what stop the output looking like a default template.
4
Let Claude check its own frames and fix the function.
It cannot watch the video, but it can inspect frames and correct the code.
Credit: @chase_ai_ on TikTok

A video is a function of time

Here’s the whole idea. Once it lands, the rest follows. Claude writes a function that takes a time, call it T, and returns one picture. Ask for sixty pictures every second and play them in order, and you’ve got a video. The same T always produces the same picture.

We lean on that stability for a reason. It’s what makes any single frame redrawable and inspectable on its own.

We treat the video as a document. Every frame is a line you can rewrite.

One function runs 60 times a second and returns 60 frames. That is the whole build.

So Claude never made a video. It wrote what the video is. The output is a description of every frame, executable exactly as written. You can change frame four hundred and eleven without touching anything else, and you can prove the output is stable. A generative model gives you a slightly different result on every call, so it can’t offer either one.

Claude does not generate the video. It writes a function that takes a time and returns one frame. Ask for sixty a second and play them in order.
Chief Content Marketer
91%
of businesses use video as a marketing tool
60
frames per second is all a coded video is: sixty stills, in order
2
free tools run the whole render: a headless browser and FFmpeg
0
per-image fees, because no image generator is involved at all

Sources: Wyzowl video marketing statistics and HubSpot’s video marketing research. The frame and tool figures are the arithmetic of the method, not a benchmark.

Claude Code rendering a JavaScript animation frame by frame
Claude Code writes the video as a function of time; the browser renders every frame.

Draw, stitch, listen

3 moving parts, and you can swap out any of them. A headless browser, usually Playwright, draws every frame, so Claude Code effectively carries its own copy of Chrome that it can look at. FFmpeg stitches the frames into an MP4. The sound is a function of T as well, so audio lines up with the picture without a separate editing pass. Nothing here is a proprietary renderer. It’s a browser and a muxer, and both are free.

That’s also why the result travels. Playwright and FFmpeg run on a laptop, a CI runner, or a server, and the output is an ordinary MP4 that any platform will accept. You’re not locked to a vendor’s export button or a credit system whose pricing changes on a Tuesday.

Apollo Inline Banner9 1

We keep the pipeline boring on purpose. One browser draws. One muxer encodes. Sixty frames, two seconds, one function.

ApproachWhat it producesHow you payBest for
Claude Code, JS function of timeA description of every frame, rendered to MP4Your existing Claude usageMotion graphics, explainers, data sequences
AI video generatorPixels a model guessed from a promptPer clip or per creditPhotoreal shots, people, scenes
Remotion or After EffectsTimeline project you build frame by frameLicence plus your timeBrand films with a dedicated editor

The middle row is where most teams start and stop. Generators are good at photoreal footage, and they’re the wrong tool for a chart that has to animate to a precise number. The row above quietly replaces the row below for anything a browser can draw.

So we render two seconds first. If the motion looks wrong, we fix the code, not the timeline.

A 30 fps draft of 2 seconds is 60 frames, or about 15 seconds of render on a laptop. Cheap enough to run on every change.

The part that makes it usable

Claude can’t watch a video, but it can look at the frames it just produced, spot what’s wrong, and fix the function. Whether it’s sixty frames or two hundred and forty, it runs the sequence in the headless browser. It inspects frame by frame and edits the code until the output is right. That loop is why the quality holds up without a human scrubbing a timeline. The agent reviews its own work at the level of the code, not the level of the pixel.

This is the same discipline behind any content quality gate: define what good looks like, then check the output against it before it ships. Here the check runs on frames, and the fix is a code edit. The loop closes on itself.

60
still images per second is all a video is here. The frames are stable, so any one can be redrawn or checked on its own, without rerendering the rest.

Codify it once, then hand it a URL

Prompting this by hand works. The durable version is to codify the whole flow into a skill that walks from step zero to a finished product. Install it as a plugin, or hand Claude Code the skill URL and let it set everything up. That covers the prerequisites: Playwright, FFmpeg, Faster Whisper, and optionally an ElevenLabs connector for the voiceover. From then on, “make me a video about X” is a single instruction.

1
Name the video as a function
Ask for one JavaScript function that takes a time and returns a frame. Describe the motion in plain language: what enters, what moves, what stays.
2
Hand it one reference image
A screenshot of a style you like, a brand palette, or a frame from a reel you admire. One image beats a paragraph of adjectives.
3
Render a short proof
2 seconds at 30 frames per second is enough to see whether the timing and the look are close. Fix the function before you spend render time on the full clip.
4
Let it check its own frames
Ask Claude to inspect the rendered frames and correct the code until the output matches the reference. It reads the frames, not the video.
5
Stitch and ship
FFmpeg assembles the frames into an MP4. Add the audio as a function of time so the voiceover and the picture stay locked together.

What to watch

We watch 3 things. The look, the code, and the render time. Three honest limits. You’re hand-building the look, so reference images matter more here than anywhere; without them the frames default to generic. This is code, so a broken function is a broken frame, and complex sequences take iteration, though the self-check loop shortens it. And the tooling is still moving, so expect rough edges. If you improve it, send the change back rather than wait for someone else to.

There’s a rendering-time reality too. A 60 fps second is fast. A five-minute film at sixty frames per second is eighteen thousand frames. Every one of them is drawn in a browser and encoded by FFmpeg. A short clip, a loop, or an explainer takes minutes. Anything feature-length is a render farm on a laptop, so plan accordingly.

The reason to care is simple: no third-party generator, no per-image fee, and a result you can reason about. You’re not paying for guesses. You’re paying for usage on code that describes exactly what the video is.

Why reference images are not optional

The single biggest lever on quality is what you show it, not what you tell it. Handed no reference, a model producing frames from code defaults to a clean, flat, unmistakably generic look, because that’s the safest thing it can build. Hand it a screenshot of a style you actually like, a brand palette, or a frame from a reel you admire. The function it writes is then aimed at something real. The frames stop being merely correct and start being yours.

References do a second job as well. They give the self-check loop something to compare against. When Claude inspects its own frames, it’s judging them against a target. A target it can see produces a far better correction than a target it only read about. The difference between a mediocre first render and a strong one is often a single image handed over at the start.

Once the MP4 exists, the last mile is captions and a trim. Descript works on the rendered file and edits by transcript, which fits a coded workflow because the words are already a timeline. The render gives you a clean picture. The polish step gives you something you can post.

Put the two ideas together and the workflow is simple. Name the library, describe the frames as a function of time, hand it a reference, and let it check its own work. That’s the whole method, and none of it requires a generator, a subscription beyond the one you have, or a payment per image.

Where this pays off
Visual explainers, product demos, pure motion graphics, and data-driven sequences where every frame is determined by numbers. Anywhere the content is a function rather than a scene. If you need a photoreal shot of a person, this is the wrong tool and a generator is the right one.

Claude JavaScript Video: Common Questions

Can Claude Code make videos without an AI video generator?

Yes. Claude Code writes the video as a JavaScript function of time, a headless browser renders each frame, and FFmpeg stitches them into an MP4. No model guesses at pixels, so there’s no per-clip fee and no generator account to manage.

What does a function of time mean for video?

It means one function takes a time value and returns exactly one frame. Run it sixty times a second and play the frames in order, and you’ve got a video. Because the same input always gives the same frame, any single frame can be redrawn or checked on its own.

Do I still need Remotion or After Effects?

Only if you want a timeline editor and a hand-built project. The coded approach replaces both for motion graphics, explainers, and data sequences. Remotion is itself code-based, so teams already comfortable there will find the mental model familiar.

Will this work for long or photoreal videos?

No, and it shouldn’t try. Every frame is drawn in a browser and encoded by FFmpeg. A five-minute film at sixty frames per second is eighteen thousand frames to render. For photoreal footage of people or scenes, an AI video generator is the right tool.

Why do reference images matter so much?

Handed no reference, code-driven frames default to a clean, flat, generic look, because that’s the safest thing to build. A screenshot of a style you actually like aims the function at something real, and it gives the self-check loop a target to compare against.

If you do one thing after reading this, do the smallest version. Write one function that takes a time and returns a frame. Render two seconds of it at 30 fps, and hand it a single reference image. The mechanism is unremarkable. One function, 60 frames, 2 seconds of video, and it costs $0 in generator fees. What changes is that you stop paying per guess, and you keep a description of the video you can edit like code. The same instinct runs through editing video with Claude Code and the animation styles you can steal. It starts when you treat the picture as something you build, not something you buy.

Get Smarter With AI, Every Week
Practical AI workflows for content marketers, one short email at a time. No fluff, no vendor spam.
Subscribe Free →
Privacy Policy