Foldline
v1.2.0Render HTML canvas animations to MP4 fast on a Mac, with 66 code-made film styles for agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
find_styles Find film styles
Search the 66 film styles by words (name, category, use, demo film). Returns one short line per style. Leave query empty to list all.
| Parameter | Type | Description |
|---|---|---|
query | string | Words to match, e.g. "paper", "news", "3d", "kids". |
get_style Get a style prompt
Returns a style's STYLE.md: its look, rules and prompt. include_demo adds DEMO.md (how its demo film was made), which is long.
| Parameter | Type | Description |
|---|---|---|
slug * | string | Style folder, e.g. "art-deco". Use find_styles to look one up. |
include_demo | boolean |
read_guide Read a guide
Reads one of the library guides. Without a section it returns the table of contents only, so you can ask for just the part you need. Guides: agents (how to direct and produce a film), director (story, sound, rhythm, camera, checks), technique (page contract, voice, music, mix), my-styles (making a style your own), tools (every command and flag), instruments (sampled instruments), readme, notice (licences).
| Parameter | Type | Description |
|---|---|---|
guide * | string | |
full | boolean | Return the whole guide. Long; prefer a section. |
section | string | Heading text (or part of it) to return, with its subsections. |
render_stills Render review stills
Renders JPEG stills of a film at given seconds, to look at before a full render. Returns the file paths. With sheet=true it also makes one contact sheet and returns it as an image, which is cheaper to look at than many stills.
| Parameter | Type | Description |
|---|---|---|
demo * | string | Folder that holds the film's index.html (absolute path, or relative to the library root). |
out | string | Folder for the stills. Default <demo>/stills. |
q | string | Query string passed to the page as location.search, e.g. 'lang=en&cut=b'. |
range | string | start:end:step in seconds, e.g. "0:30:5". |
sheet | boolean | Also make a contact sheet (needs the Python environment) and return it inline. |
sheet_cols | integer | |
size | string | Frame size WxH, even numbers. Default 1920x1080; 1080x1920 for a vertical Short. |
times | array | Seconds to render, e.g. [0, 2.5, 10]. |
render_video Render the film to MP4
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.
| Parameter | Type | Description |
|---|---|---|
demo * | string | Folder that holds the film's index.html (absolute path, or relative to the library root). |
allow_short_audio | boolean | Set true only when the soundtrack is meant to end before the film: it is then left short instead of padded. Default false. |
audio | string | 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 | string | auto (default) tries WebCodecs, then VideoToolbox, then x264. |
fps | number | Default 24. |
mbps | number | Bitrate for the WebCodecs path. Default 20. |
out | string | Output mp4. Default <demo>/out/video.mp4. Each parallel render needs its own out. |
q | string | Query string passed to the page as location.search, e.g. 'lang=en&cut=b'. |
size | string | Frame size WxH, even numbers. Default 1920x1080; 1080x1920 for a vertical Short. |
workers | integer | Parallel browser workers. Default 3. |
check_reading Check on-screen text timing
Checks that every on-screen text stays fully in frame long enough to read (the page must expose window.TEXTS(t)). Returns only the failures and a count.
| Parameter | Type | Description |
|---|---|---|
demo * | string | Folder that holds the film's index.html (absolute path, or relative to the library root). |
cjk_cps | number | CJK characters per second. Default 4.5. |
latin_cps | number | Latin characters per second. Default 15. |
q | string | Query string passed to the page as location.search, e.g. 'lang=en&cut=b'. |
size | string | Frame size WxH, even numbers. Default 1920x1080; 1080x1920 for a vertical Short. |
step | number | Seconds between checks. Default 0.04. |
export_events Export sound cues
Exports the page's window.DUR and window.EV (sound and cue events) to JSON for the mix. Returns the path and the number of events.
| Parameter | Type | Description |
|---|---|---|
demo * | string | Folder that holds the film's index.html (absolute path, or relative to the library root). |
out | string | Default <demo>/events.json. |
q | string | Query string passed to the page as location.search, e.g. 'lang=en&cut=b'. |
size | string | Frame size WxH, even numbers. Default 1920x1080; 1080x1920 for a vertical Short. |
make_voice Make voice lines (TTS)
Turns lines of text into trimmed WAV files and dur.json. engine "kokoro" is offline (default); "edge" is Microsoft Edge TTS, online; "qwen" is Qwen3-TTS on MLX (Mac with Apple silicon, local, free; voices ryan, aiden, vivian, serena, uncle_fu, dylan, eric, ono_anna, sohee; per-line instruct; numbers spelled out; every take checked for a cut end and by Whisper, bad takes redone). Returns each line's duration. Needs the voice tier (setup.sh deps voice), or for qwen the qwen tier (setup.sh deps qwen; the model, about 3.1 GB, downloads on first use).
| Parameter | Type | Description |
|---|---|---|
lines * | array | |
out_dir * | string | Folder for <id>.wav and dur.json. lines.json is written there too. |
engine | string |
check_voice Check voice lines with speech-to-text
Runs Whisper over every <id>.wav and compares it with the text. Writes words.json (word timestamps). Returns only the lines that failed and a count.
| Parameter | Type | Description |
|---|---|---|
lines_json * | string | The lines.json used for the voice. |
voices_dir * | string | |
lang | string |
mux_audio Mux and master sound
Puts a mix under the video: two-pass loudness to -14 LUFS, true peak -1.2 dB, optional film grain. A mix shorter than the video is padded with silence, a longer one cut at the end. Before handing over, it checks the frame count and that the sound starts and ends with the picture. Returns the output path and the measured loudness.
| Parameter | Type | Description |
|---|---|---|
audio * | string | The mix, e.g. mix.wav. |
out * | string | |
video * | string | |
fps | number | Default 24. |
grain | number | Film grain, 0 for none. Default 2. |
make_subtitles Make an SRT file
Writes an .srt subtitle file from cues.
| Parameter | Type | Description |
|---|---|---|
cues * | array | |
out * | string | Path of the .srt. |
fetch_assets Download optional big assets
Downloads assets that are not shipped with Foldline into its library folder: the Kokoro voice model (voice), the HDRI skies that 3D styles light with (hdri), or a sampled instrument library (instruments).
| Parameter | Type | Description |
|---|---|---|
what * | string | |
lib | string | For instruments: which library. |