Reference

Rendering

Outputs, aspects, covers and chapters, the quality of the blur, and the heat defaults: utility QoS, a third of the cores and an 80 °C governor.

Outputs

  • Files: the output’s extension picks the format. .mp4 (H.264, or HEVC with HEVC=1), .mov (ProRes 422 HQ), .webm, .gif.
  • Aspects: 16:9, 1:1, 4:5 or 9:16. A second aspect is a second layout, composed for its own frame, never a crop of the first.
  • Size and speed: 60 fps and 1080p on the long side by default.
  • Covers: a still per aspect (render.mjs stills stills 0 is frame 0).
  • Chapters: a timeline of scenes carries a film of any length; chapters land in the mp4 and in a list for a YouTube description. A film that declares chapters needs three or more, the first at 0, each at least 10 seconds.

Quality

Sixteen subframes a frame are the motion blur. Each also gets a different subpixel offset on a 4×4 grid, so the blend is a 16-sample antialias as well: Chrome snaps text to whole pixels, and without it text in a slow move stepped a pixel every few frames. Rasters go through FILM.draw, which mipmaps what Chrome does not. On a real 28 s release film the worst slow-move flicker fell 37–76 %, at the same render time.

A frame that moves fast (a push, a whip) gets 48 subframes instead: at 16 its moments showed as copies about 12 px apart. A quick pass measures every frame’s speed first; on a 56 s reel 8.5 % of the frames were fast, a render about a fifth longer. The shutter (SHUTTER, 360° by default) sets how much of each frame the sixteen cover: 180° is a film camera’s, crisper, at the same cost.

Checks

A page that loses a WebGL context (Chrome keeps 16 a page, and a lost one draws nothing) fails the capture instead of delivering an empty backdrop, and each cut keeps its chunks in a folder of its own, so a square cut never deletes the master’s. Before the first frame, the soundtrack: a file without sound or an AUDIO_AT past its end stops the render, a track shorter than the film or a silent stretch is said. After the last, the file: its size, frames, length and sound are read back, and a file that does not match fails the render.

Length

  • PREVIEW=1 drafts the whole film at a sixteenth of the work.
  • FROM and TO render one chapter or one transition.
  • RESUME=1 picks up a stopped render from its chunks, refusing when the page, its scripts or the settings changed.
  • KEEP=1 keeps the chunks, so another format is an encode, not a render.

Heat

A render keeps the chip busy for minutes, and a run of test renders once took it to 91 °C. The renderer runs cool by default; these measurements chose the defaults: 8 s of reel.html (1080p60, 16 subframes) on an M5 Pro, with other work on the machine.

WorkersQoS classGovernorTimePeakHeld
12default86 °C77 s87.9 °C16 s
6default86 °C117 s86.7 °C4 s
12default80 °C250 s85.5 °C198 s
12utility80 °C248 s81.8 °C76 s
6utility80 °C231 s80.0 °C0 s
12background86 °C1039 s80.1 °C*0 s

* another session’s work on the machine; its own load held about 60 °C.

  • The defaults are the bold row: a third of the cores (WORKERS), the utility QoS class (QOS), the governor at 80 °C (TEMP_MAX). At the same ceiling full speed is slower and hotter: it heats past the ceiling before the governor can hold it, then spends most of the render cooling (198 s of 250).
  • A long film takes longer, not hotter. At the defaults this reel renders at about 29× real time; a film without WebGL fields or dither, faster. Draft with PREVIEW=1; leave a very long master to QOS=background, the coolest, at a third of the speed.
  • Faster, knowingly: QOS=default WORKERS=12 TEMP_MAX=86 is the old behaviour, for a short film when you ask for speed. One render at a time, always.
  • The governor reads the chip, not the render, so heat from other work holds the render too. It needs swiftc (Xcode’s command-line tools) to build thermo.swift once; without it, macOS’s own thermal state, which only acts at “serious”.
  • Spotlight: the scratch folders end in .noindex, because chunks written and deleted by the thousand kept Spotlight’s indexers busy after a render.

Delivery

The finished films leave the work folder for a folder of their own, and the work folder goes to the Trash once its source is safe in the product’s kit. See Making a film. deliver.mjs puts each cover through ImageOptim when it is installed, with an SSIM against the original: a real release film’s posters went from 1.0 MB to 0.13 MB at SSIM 0.9995.