Render the film to MP4
render_videoRender every frame of a film to H.264 MP4 at low priority, validate that all frames decode and audio spans the film, and return output path, frame count, time, and encoder.
Instructions
Renders every frame of a film to an H.264 MP4 at low priority, with the in-page hardware encoder by default. Before saving, it checks the file: every rendered frame decodes and the soundtrack runs from the start to the end of the film; a short or misaligned file fails. Returns the output path, frame count, time and encoder (enc=wc is the fast path), not the progress log. Sends progress if the client asks for it.
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": {
"demo": "<demo>"
},
"name": "render_video"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Query string passed to the page as location.search, e.g. 'lang=en&cut=b'. | |
| fps | No | Default 24. | |
| out | No | Output mp4. Default <demo>/out/video.mp4. Each parallel render needs its own out. | |
| demo | Yes | Folder that holds the film's index.html (absolute path, or relative to the library root). | |
| mbps | No | Bitrate for the WebCodecs path. Default 20. | |
| size | No | Frame size WxH, even numbers. Default 1920x1080; 1080x1920 for a vertical Short. | |
| audio | No | Sound file to mux in (AAC 192k). A soundtrack shorter than the film is padded with silence; a longer one is cut at the end. For a mastered mix use mux_audio instead. | |
| encoder | No | auto (default) tries WebCodecs, then VideoToolbox, then x264. | |
| workers | No | Parallel browser workers. Default 3. | |
| allow_short_audio | No | Set true only when the soundtrack is meant to end before the film: it is then left short instead of padded. Default false. |