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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"draw_code": "<draw_code>"
},
"name": "render_video"
}
}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 |