Skip to main content

Class: WebCodecsExporter

Defined in: src/export/WebCodecsExporter.ts:264

Deterministic WebCodecs-based video exporter for manim-web scenes.

Constructors​

Constructor​

new WebCodecsExporter(scene, options?): WebCodecsExporter

Defined in: src/export/WebCodecsExporter.ts:273

Create a new WebCodecsExporter.

Parameters​

scene​

ExportableScene

The scene to export

options?​

WebCodecsExportOptions

Export options

Returns​

WebCodecsExporter

Methods​

export()​

export(): Promise<Blob>

Defined in: src/export/WebCodecsExporter.ts:295

Export the scene to a video Blob.

Seeks and captures one VideoFrame per timeline frame, encodes it with the WebCodecs VideoEncoder, and muxes the encoded chunks into the configured container, together with the audio track when there is one.

Returns​

Promise<Blob>

A Promise that resolves to the video Blob

Throws​

Error if WebCodecs is unavailable (use VideoExporter instead)


getOptions()​

getOptions(): Readonly<ResolvedWebCodecsExportOptions>

Defined in: src/export/WebCodecsExporter.ts:658

Get the resolved export options.

Returns​

Readonly<ResolvedWebCodecsExportOptions>


startCapture()​

startCapture(): Promise<WebCodecsCaptureSession>

Defined in: src/export/WebCodecsExporter.ts:341

Start a frame-by-frame capture of the scene canvas, for a scene that the caller moves forward itself (for example the live play() loop under a fake clock). Transparent (alpha) export is only available through export.

Returns​

Promise<WebCodecsCaptureSession>

Throws​

Error if WebCodecs is unavailable or alpha is set


isSupported()​

static isSupported(): boolean

Defined in: src/export/WebCodecsExporter.ts:281

Feature-detect WebCodecs. Returns true when VideoEncoder is available.

Returns​

boolean