av
The av namespace — the engine's Luau API reference for av.
The av namespace — 7 functions.
globals/av/is_live
globals/av/is_live() -> boolean
True if a live-stream session is currently active.
globals/av/is_recording
globals/av/is_recording() -> boolean
True if a recording session is currently active.
globals/av/live
globals/av/live(opts: LiveOpts?) -> string?
Start the live-stream encoder. The stream is served at
/engine/live.stream and reverse-proxied at
/stream/<instance>/live.stream as a binary length-prefixed
protocol consumed by the multiviewer UI's WebCodecs decoder.
When texture_handle is set, the encoder reads from that GPU
texture's guid (a Camera pointed at it via setTargetTexture)
instead of the scene's viewport — that's how spectator cameras
work. Returns a stream URL, or nil when unsupported or a
session is already active.
globals/av/record
globals/av/record(path: string, opts: RecordOpts?) -> string
Start recording the engine output to a VFS path. Default dir
is /zero/runtime/recordings/ when path is not absolute.
With no chroma/range opts the format defaults to full-range
4:4:4 HEVC where the GPU supports it, else 4:2:0 limited.
Returns a promise handle — use task.await() for the final
result.
globals/av/status
globals/av/status() -> AvStatus
Report the encoder subsystem's state. Always available
regardless of GPU support. Returns
{ supported, reason, backend, live, recording } — backend is
the hardware encode backend in use ("vulkan" or "vaapi")
when supported.
globals/av/stop_live
globals/av/stop_live() -> boolean
Stop any active live-stream session.
globals/av/stop_recording
globals/av/stop_recording(handle: string?) -> boolean
Stop the active recording (or the one for the given promise handle). The promise resolves with the final result once stop completes.