Interface Encoder
access this type via: media.video.Encoder (provides, requires or uses)
--- semantic variants: h264, av1
API to encode video frames.
Functions
Encoder(storeWH size, int framesPerSecond, optional KeyValue options[])
EncodedFrame[] encode(PixelMapYUV frame, bool keyFrame)
EncodedFrame[] finish()
Encoder(storeWH size, int framesPerSecond, optional KeyValue options[])
Instantiate a new encoder, for a given video resolution (size), a frames-per-second value, and a set of optional configuration options.
EncodedFrame[] encode(PixelMapYUV frame, bool keyFrame)
Encode the next video frame, indicating whether or not it should be a keyframe.
EncodedFrame[] finish()
Finish encoding, which may return a final batch of encoded frames.