textmode.export.js / VideoExportOptions
Type Alias: VideoExportOptions
type VideoExportOptions = object;Options for exporting the textmode content to video format.
Properties
filename?
optional filename?: string;Target filename without extension. Defaults to an auto-generated value.
format?
optional format?: VideoExportFormat;Video container format. Defaults to 'mp4'.
frameCount?
optional frameCount?: number;Desired total number of frames to capture. Defaults to 300.
frameRate?
optional frameRate?: number;Target frame rate for the export, in frames per second. Defaults to 60.
bitrate?
optional bitrate?: number | VideoBitratePreset;Target bitrate in bits per second or a bitrate preset. Defaults to 'medium'.
Bitrate controls how much encoded data is available per second of video. Higher values can preserve more detail in noisy or fast-changing sketches, but create larger files. Presets are resolved from the export dimensions and frame rate; numeric values are passed directly to the encoder.
bitrateMode?
optional bitrateMode?: VideoBitrateMode;Encoder bitrate allocation mode. Defaults to 'variable'.
Use 'variable' for most exports so simple frames can compress efficiently and complex frames can receive more bits. Use 'constant' only when a steadier data rate is more important than compression efficiency.
latencyMode?
optional latencyMode?: VideoLatencyMode;Encoder latency mode. Defaults to 'quality'.
Use 'quality' for deterministic exports; it prioritizes completed output and avoids dropped frames. Use 'realtime' only for low-latency use cases where dropped frames are acceptable.
hardwareAcceleration?
optional hardwareAcceleration?: VideoHardwareAcceleration;WebCodecs hardware acceleration hint. Defaults to 'no-preference'.
Browsers may ignore this hint. 'prefer-hardware' can be faster on supported devices; 'prefer-software' can be more predictable but slower. 'no-preference' lets the browser choose.
keyFrameInterval?
optional keyFrameInterval?: number;Key frame interval in seconds. Defaults to 2.
Key frames are independently decodable frames used for seeking and recovery. Shorter intervals improve seeking responsiveness but increase file size. Longer intervals can shrink files but make seeking less precise. Use 0 to request every frame as a key frame.
pixelDensity?
optional pixelDensity?: number;Pixel density used during export. Defaults to 1 so video dimensions match the live canvas.
signal?
optional signal?: AbortSignal;Abort signal for cancelling an in-progress export.
transparent?
optional transparent?: boolean;When true, attempts to preserve alpha data in WebM recordings. MP4 exports reject this option.
onProgress?
optional onProgress?: (progress) => void;Progress callback invoked throughout the recording lifecycle.
Parameters
| Parameter | Type |
|---|---|
progress | VideoExportProgress |
Returns
void
debugLogging?
optional debugLogging?: boolean;Enables verbose logging. Defaults to false.