VideoEncoderCore

open class VideoEncoderCore

This class wraps up the core components used for surface-input video encoding.

Once created, frames are fed to the input surface. Remember to provide the presentation time stamp, and always call drainEncoder() before swapBuffers() to ensure that the producer side doesn't get backed up.

This class is not thread-safe, with one exception: it is valid to use the input surface on one thread, and drain the output on a different thread.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, bitRate: Int, frameRate: Int, outputFile: File)
Configures encoder and muxer state, and prepares the input Surface.

Functions

Link copied to clipboard
open fun drainEncoder(endOfStream: Boolean)
Extracts all pending data from the encoder and forwards it to the muxer.
Link copied to clipboard
Returns the encoder's input surface.
Link copied to clipboard
open fun release()
Releases encoder resources.