render_video
Render JavaScript canvas animations into MP4 video. Provide a draw(ctx, t, frame) function to create motion graphics, animated diagrams, and explainers, and receive a file path plus sample frames.
Instructions
Render an MP4 from JavaScript canvas animation code you author. Provide draw(ctx, t, frame) as a pure function of time t in seconds (deterministic — no requestAnimationFrame, no Date.now). Optional setup(ctx) runs once. Use for motion graphics, animated diagrams, explainers. Returns file path plus sample frames.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | ||
| width | No | ||
| height | No | ||
| filename | No | ||
| draw_code | Yes | JS defining function draw(ctx, t, frame) and optionally setup(ctx) | |
| duration_seconds | No |