Render an animation to a WebM video
riv_render_videoRender .riv animations or state machines to WebM video with configurable size, frame rate, and duration.
Instructions
Render a .riv animation (or state machine) to a real-time WebM video using canvas.captureStream() + MediaRecorder (VP9, falls back to VP8/generic webm). Default duration is one loop of the animation (2s for a bare state machine or when the animation's length can't be determined).
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": {
"path": "<path>"
},
"name": "riv_render_video"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | captureStream() frame rate (default 30) | |
| out | No | Output .webm path (default: alongside the .riv) | |
| path | Yes | Path to the .riv file | |
| width | No | Output width in px (default: artboard width) | |
| height | No | Output height in px (default: keeps the artboard aspect ratio) | |
| artboard | No | Artboard name (default: first artboard) | |
| duration | No | Seconds to record (default: one animation loop, or 2s) | |
| animation | No | Animation name; ignored when stateMachine is set (default: the first state machine, else the first animation) | |
| background | No | CSS background color (default: transparent) | |
| stateMachine | No | State machine name (takes precedence over animation) |