encode

fun encode(frame: VideoFrame, options: VideoEncoderEncodeOptions = definedExternally)(source)

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.

MDN Reference