VideoEncoder

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The VideoEncoder interface of the WebCodecs API encodes VideoFrame objects.

Constructor

VideoEncoder() Experimental

Creates a new VideoEncoder object.

Properties

VideoEncoder.encodeQueueSize Read only Experimental

An integer representing the number of encode queue requests.

VideoEncoder.state Read only Experimental

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

Methods

VideoEncoder.configure() Experimental

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

VideoEncoder.encode() Experimental

Enqueues a control message to encode a given VideoFrame.

VideoEncoder.flush() Experimental

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

VideoEncoder.isConfigSupported() Experimental

Returns a promise indicating whether the provided VideoEncoderConfig is supported.

VideoEncoder.reset() Experimental

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

VideoEncoder.close() Experimental

Ends all pending work and releases system resources.

Specifications

Specification
WebCodecs
# videoencoder-interface

Browser compatibility

BCD tables only load in the browser

See also