web api interface
VideoEncoder
Secure contextAvailable in workers
The VideoEncoder interface of the WebCodecs API encodes VideoFrame objects into EncodedVideoChunks.
Constructor
VideoEncoder()- : Creates a new
VideoEncoderobject.
- : Creates a new
Instance properties
Inherits properties from its parent, EventTarget.
encodeQueueSizeRead only- : An integer representing the number of encode queue requests.
stateRead only- : Represents the state of the underlying codec and whether it is configured for encoding.
Events
dequeue- : Fires to signal a decrease in
encodeQueueSize.
- : Fires to signal a decrease in
Static methods
VideoEncoder.isConfigSupported()- : Returns a promise indicating whether the provided
VideoEncoderConfigis supported.
- : Returns a promise indicating whether the provided
Instance methods
Inherits methods from its parent, EventTarget.
configure()- : Asynchronously prepares the encoder to accept video frames for encoding with the specified parameters.
encode()- : Asynchronously encodes a
VideoFrame.
- : Asynchronously encodes a
flush()- : Returns a promise that resolves once all pending encodes have been completed.
reset()- : Cancels all pending encodes and callbacks.
close()- : Ends all pending work and releases system resources.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.