preview
Open a live window that plays a Lua video script with sound and reloads when the script or media change; users mark ranges and moments there, saved to a marks file you read back.
Instructions
A window that plays the video (or a video or sound file) with sound and reloads when the script or media change; the user marks ranges ([ ]) and moments (P) for you there; playback that misses frames renders smaller (down to 25%), paused frames at full size. It opens for the user and the call returns at once; the window stays open (one per script). What the user marks is in the file beside the script or clip (NAME.marks.json): read it with show, path marks.
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": {
"script": "<script>"
},
"name": "preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | where to start, a time spec (default: the start) | |
| now | No | the wall clock at the video's first frame (Lua: f.now, seconds since 1970): an RFC 3339 time with its zone (2026-11-02T14:05:00Z, 2026-11-02T15:05:00+01:00) or seconds since 1970; preview --live runs on the system clock instead (default: 0, 1970-01-01T00:00:00Z) | |
| set | No | script arguments (Lua: arg.K, a string) that also set props.K (a number when it looks like one); they win over a batch row, which wins over the props file | |
| bare | No | the video alone (no controls, panels or timeline), played once, then the window closes; Escape closes it sooner | |
| live | No | a live board (signage): the video alone, fullscreen, played once and then running on past its end for good, f.now the system clock; a changed file beside the script swaps the new version in without a pause (a failing one keeps the last good one and says why on stderr); no keys but Control+Q | |
| mute | No | no sound | |
| media | No | fonts, images and sounds (default: media/ beside the script) | |
| props | No | a JSON object the script reads as the table props (props.title, ...) | |
| scale | No | output resolution factor, e.g. 0.5 for half resolution (rounded to an even size) | |
| paused | No | open paused | |
| script | Yes | the video script (.lua) | |
| no_loop | No | stop at the end | |
| present | No | a presentation: the video alone, fullscreen, waiting at each scene's end (its hold) for Right, Space, Page Down or a click; Left or Page Up back a scene, B black, P pause, Escape closes | |
| software | No | draw on the CPU instead of the GPU | |
| fullscreen | No | open fullscreen (F toggles) |