Interface: WebCodecsExportOptions
Defined in: src/export/WebCodecsExporter.ts:62
Options for configuring WebCodecs video export.
Properties
alpha?
optionalalpha:boolean
Defined in: src/export/WebCodecsExporter.ts:93
Export with a transparent background, so the video carries an alpha channel to composite over other footage. Defaults to false.
Alpha needs the 'webm' format with the 'vp9' codec, because only that path
carries an alpha side channel. When alpha is set and format/codec are
not given, they default to 'webm' and 'vp9'. It also needs a Scene created
with { alpha: true } (or backgroundOpacity < 1) and a browser that can
encode VP9 with alpha. When any requirement is unmet, export() throws a
clear error instead of producing opaque video that claims transparency.
A transparent export keeps its audio: an Opus track next to the VP9 video.
audioBitrate?
optionalaudioBitrate:number
Defined in: src/export/WebCodecsExporter.ts:114
Audio bitrate in bits per second. Defaults to 128_000.
audioManager?
optionalaudioManager:AudioMixdownSource
Defined in: src/export/WebCodecsExporter.ts:112
An external AudioManager for the audio track. When not given, the scene's
audioManager is used.
audioSampleRate?
optionalaudioSampleRate:number
Defined in: src/export/WebCodecsExporter.ts:116
Audio sample rate in Hz. Defaults to 48_000 (Opus needs 48 kHz).
bitrate?
optionalbitrate:number
Defined in: src/export/WebCodecsExporter.ts:70
Target bitrate in bits per second. Defaults to 5_000_000.
codec?
optionalcodec:WebCodecsVideoCodec
Defined in: src/export/WebCodecsExporter.ts:68
Video codec. Defaults to 'avc' for mp4 and 'vp9' for webm.
duration?
optionalduration:number
Defined in: src/export/WebCodecsExporter.ts:76
Duration in seconds. Auto-detects from the timeline if not specified.
format?
optionalformat:"webm"|"mp4"
Defined in: src/export/WebCodecsExporter.ts:66
Container format. Defaults to 'mp4'.
fps?
optionalfps:number
Defined in: src/export/WebCodecsExporter.ts:64
Frames per second. Defaults to 60.
height?
optionalheight:number
Defined in: src/export/WebCodecsExporter.ts:74
Output height in pixels. Defaults to scene height.
includeAudio?
optionalincludeAudio:boolean
Defined in: src/export/WebCodecsExporter.ts:107
Include an audio track mixed down from the AudioManager. Defaults to true when the AudioManager has clips at the start of the export, else false.
In mp4 the track is AAC. The AAC encoder adds priming samples in front; the exporter keeps every source sample and writes an edit list that tells the player to skip the priming. A player that ignores mp4 edit lists plays the audio about 44 ms (2112 samples at 48 kHz) late.
In webm the track is Opus. webm-muxer writes no end trimming, so the decoded audio ends on a whole 20 ms Opus frame: up to 20 ms longer than the video, never shorter.
keyFrameInterval?
optionalkeyFrameInterval:number
Defined in: src/export/WebCodecsExporter.ts:78
Frames between key frames. Defaults to the frame rate (one per second).
onProgress()?
optionalonProgress: (progress) =>void
Defined in: src/export/WebCodecsExporter.ts:80
Progress callback (0-1).
Parameters
progress
number
Returns
void
width?
optionalwidth:number
Defined in: src/export/WebCodecsExporter.ts:72
Output width in pixels. Defaults to scene width.