VideoEncoder

The VideoEncoder interface of the WebCodecs API encodes VideoFrame objects.

EventTarget VideoEncoder

Constructor

VideoEncoder()

Creates a new VideoEncoder object.

Instance properties

Inherits properties from its parent, EventTarget.

VideoEncoder.encodeQueueSize Read only

An integer representing the number of encode queue requests.

VideoEncoder.state Read only

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

Events

dequeue

Fires to signal a decrease in VideoEncoder.encodeQueueSize.

Static methods

VideoEncoder.isConfigSupported()

Returns a promise indicating whether the provided VideoEncoderConfig is supported.

Instance methods

Inherits methods from its parent, EventTarget.

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