VideoEncoder

The VideoEncoder interface of the WebCodecs API encodes VideoFrame objects.

Constructor

VideoEncoder()

Creates a new VideoEncoder object.

Properties

VideoEncoder.encodeQueueSizeRead only

An integer representing the number of encode queue requests.

VideoEncoder.stateRead only

Represents the state of the underlying codec and whether it is configured for encoding.

Methods

VideoEncoder.configure()

Enqueues a control message to configure the video encoder for encoding chunks.

VideoEncoder.encode()

Enqueues a control message to encode a given VideoFrame.

VideoEncoder.flush()

Returns a promise that resolves once all pending messages in the queue have been completed.

VideoEncoder.reset()

Resets all states including configuration, control messages in the control message queue, and all pending callbacks.

VideoEncoder.close()

Ends all pending work and releases system resources.

Specifications

Specification
WebCodecs
# videoencoder-interface

Browser compatibility

BCD tables only load in the browser

See also