VideoEncoder
The VideoEncoder interface of the WebCodecs API encodes VideoFrame objects into EncodedVideoChunks. Available only in secure contexts.
Properties
The encodeQueueSize read-only property of the VideoEncoder interface returns the number of pending encode requests in the queue.
The state read-only property of the VideoEncoder interface returns the current state of the underlying codec.
Functions
The configure() method of the VideoEncoder interface changes the state of the encoder to "configured" and asynchronously prepares the encoder to accept VideoEncoders for encoding with the specified parameters. If the encoder doesn't support the specified parameters or can't be initialized for other reasons an error will be reported via the error callback provided to the VideoEncoder constructor.
The encode() method of the VideoEncoder interface asynchronously encodes a VideoFrame. Encoded data (EncodedVideoChunk) or an error will eventually be returned via the callbacks provided to the VideoEncoder constructor.
The flush() method of the VideoEncoder interface forces all pending encodes to complete.
The flush() method of the VideoEncoder interface forces all pending encodes to complete.