Builtin Library
README.md
recording
Record a video clip (MP4) of the scene as it shows, or of the whole editor
window with its panels: a screen recording for a trailer, a post or a bug report.
Takes are named by the local date and time and filed
under /zero/source/local/recordings/, this machine's own content. A take is
written to disk as it records, so it holds no engine memory, survives a
restart and is never synced to a world.
The loop this is for
recording.start -- the scene view; F9 in the editor does the same
… work …
recording.status -- seconds of film and bytes written so far
recording.stop -- ends the take and reports the file
recording.list -- every take, newest first
recording.start window films the whole editor window instead. The scene view
shows what the viewport shows, so switch the editor's overlays off before a
take that should be clean.
A master for editing and delivery
recording.start takes the options that cut a master: quality (1 to 100, 100
is the near-lossless picture), width and height (a 4K take is 3840 by
2160), cadence "frame" with seconds for a timeline that
advances a step per rendered frame, audioTrack (the VFS path of a pre-mixed
wav, ogg, mp3 or flac the take carries as its sound; it starts at the first
frame and ends where the film does, on either cadence) and name (the file
name under the recordings directory). man recording and the recording guide
(guides recording) carry the whole set.
Getting a take out of the engine
A take is the machine's own content, kept in the engine's blob store under
/zero/source/local/recordings/: it has an engine path, and no folder of its
own on the host disk to point at. To hand it to a person:
- in the editor, the Recording panel's Save to this device (the browser
downloads it, a native engine opens its save dialog);
Recording.save(path)anduserfile.save(path)do the same from Luau; - an engine with no window has no one at its screen to save to: serve the take
from a route (
httpServer.route("GET", "/take", function() return { file = "<engine path>" } end)) and fetch the addresshttpServer.address("/take")names.
The tools
| Tool | What it does |
|---|---|
start [scope] [camera] [fps] [audio] | Start a take. Scope is viewport (default) or window. |
stop | End the take and wait for the engine to file it. |
status | Whether a take runs, its file, seconds and bytes so far. |
list | The takes on this machine, newest first. |
The same service is require("modules.api.editor.recording") in Luau.