# VideoEncoder

open class VideoEncoder : BaseEncoder, GetCameraData

Created by pedro on 19/01/17. This class need use same resolution, fps and imageFormat that Camera1ApiManagerGl

## Constructors

VideoEncoder
Link copied to clipboard
constructor(getVideoData: GetVideoData)

## Properties

bitRate
Link copied to clipboard
open val bitRate: Int
fps
Link copied to clipboard
open var fps: Int
height
Link copied to clipboard
open val height: Int
inputSurface
Link copied to clipboard
open var inputSurface: Surface
rotation
Link copied to clipboard
open var rotation: Int
width
Link copied to clipboard
open val width: Int

## Functions

forceBt709Color
Link copied to clipboard
open fun forceBt709Color(enabled: Boolean)
forceCodecType
Link copied to clipboard
open fun forceCodecType(codecType: CodecUtil.CodecType)
formatChanged
Link copied to clipboard
open fun formatChanged(@NonNull mediaCodec: MediaCodec, @NonNull mediaFormat: MediaFormat)
getType
Link copied to clipboard
open fun getType(): String
inputAvailable
Link copied to clipboard
open fun inputAvailable(@NonNull mediaCodec: MediaCodec, inBufferIndex: Int)
abstract fun inputAvailable(mediaCodec: MediaCodec, inBufferIndex: Int)
inputYUVData
Link copied to clipboard
open fun inputYUVData(@NonNull frame: Frame)
isRunning
Link copied to clipboard
open fun isRunning(): Boolean
outputAvailable
Link copied to clipboard
open fun outputAvailable(@NonNull mediaCodec: MediaCodec, outBufferIndex: Int, @NonNull bufferInfo: MediaCodec.BufferInfo)
abstract fun outputAvailable(mediaCodec: MediaCodec, outBufferIndex: Int, bufferInfo: MediaCodec.BufferInfo)
prepareVideoEncoder
Link copied to clipboard
open fun prepareVideoEncoder(): Boolean
Prepare encoder with default parameters
open fun prepareVideoEncoder(width: Int, height: Int, fps: Int, bitRate: Int, rotation: Int, iFrameInterval: Int, formatVideoEncoder: FormatVideoEncoder): Boolean
open fun prepareVideoEncoder(width: Int, height: Int, fps: Int, bitRate: Int, rotation: Int, iFrameInterval: Int, formatVideoEncoder: FormatVideoEncoder, profile: Int, level: Int): Boolean
Prepare encoder with custom parameters
requestKeyframe
Link copied to clipboard
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
open fun requestKeyframe()
reset
Link copied to clipboard
open fun reset(): Boolean
restart
Link copied to clipboard
open fun restart()
setEncoderErrorCallback
Link copied to clipboard
open fun setEncoderErrorCallback(encoderErrorCallback: CodecErrorCallback)
setForceFps
Link copied to clipboard
open fun setForceFps(fps: Int)
setTimestampMode
Link copied to clipboard
open fun setTimestampMode(timestampMode: TimestampMode)
setType
Link copied to clipboard
open fun setType(type: String)
setVideoBitrateOnFly
Link copied to clipboard
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
open fun setVideoBitrateOnFly(bitrate: Int)
start
Link copied to clipboard
open fun start()
open fun start(startTs: Long)
open fun start(resetTs: Boolean)
stop
Link copied to clipboard
open fun stop()
open fun stop(resetTs: Boolean)