encodeImage

expect fun encodeImage(codec: CodecId = CodecId.Mjpeg): ByteArray

Encode this (video) frame as a standalone compressed image: MJPEG (.jpg) by default, or CodecId.Png. This converts the pixel format automatically when the image codec does not accept the frame's own (e.g. yuv420p → rgb24 for PNG). It leaves this frame untouched, timestamp included, so a frame can be thumbnailed and still encoded into a video.

Throws

on audio frames, frames without image data, or encode failure

actual fun encodeImage(codec: CodecId): ByteArray

Encode this (video) frame as a standalone compressed image: MJPEG (.jpg) by default, or CodecId.Png. This converts the pixel format automatically when the image codec does not accept the frame's own (e.g. yuv420p → rgb24 for PNG). It leaves this frame untouched, timestamp included, so a frame can be thumbnailed and still encoded into a video.

Throws

on audio frames, frames without image data, or encode failure

actual fun encodeImage(codec: CodecId): ByteArray

Encode this (video) frame as a standalone compressed image: MJPEG (.jpg) by default, or CodecId.Png. This converts the pixel format automatically when the image codec does not accept the frame's own (e.g. yuv420p → rgb24 for PNG). It leaves this frame untouched, timestamp included, so a frame can be thumbnailed and still encoded into a video.

Throws

on audio frames, frames without image data, or encode failure

actual fun encodeImage(codec: CodecId): ByteArray

Encode this (video) frame as a standalone compressed image: MJPEG (.jpg) by default, or CodecId.Png. This converts the pixel format automatically when the image codec does not accept the frame's own (e.g. yuv420p → rgb24 for PNG). It leaves this frame untouched, timestamp included, so a frame can be thumbnailed and still encoded into a video.

Throws

on audio frames, frames without image data, or encode failure

actual fun encodeImage(codec: CodecId): ByteArray

Encode this (video) frame as a standalone compressed image: MJPEG (.jpg) by default, or CodecId.Png. This converts the pixel format automatically when the image codec does not accept the frame's own (e.g. yuv420p → rgb24 for PNG). It leaves this frame untouched, timestamp included, so a frame can be thumbnailed and still encoded into a video.

Throws

on audio frames, frames without image data, or encode failure