VideoEncoderSettings.Builder


class VideoEncoderSettings.Builder


Builds VideoEncoderSettings instances.

Summary

Public constructors

Creates a new instance.

Public functions

VideoEncoderSettings!

Builds the instance.

VideoEncoderSettings.Builder!

Sets bitrate.

VideoEncoderSettings.Builder!

Sets bitrateMode.

VideoEncoderSettings.Builder!

Sets encoding operating rate and priority.

VideoEncoderSettings.Builder!
@CanIgnoreReturnValue
setEncodingProfileLevel(encodingProfile: Int, encodingLevel: Int)

Sets profile and level.

VideoEncoderSettings.Builder!

Sets the maximum number of B frames allowed between I or P frames in the produced video.

VideoEncoderSettings.Builder!

Sets the threshold duration between input frames beyond which to repeat the previous frame if no new frame has been received, in microseconds.

VideoEncoderSettings.Builder!
@CanIgnoreReturnValue
setTemporalLayers(
    numNonBidirectionalLayers: Int,
    numBidirectionalLayers: Int
)

Sets the number of temporal layers to request from the video encoder.

VideoEncoderSettings.Builder!

Sets iFrameIntervalSeconds.

Public constructors

Builder

Builder()

Creates a new instance.

Public functions

build

fun build(): VideoEncoderSettings!

Builds the instance.

setBitrate

@CanIgnoreReturnValue
fun setBitrate(bitrate: Int): VideoEncoderSettings.Builder!

Sets bitrate. The default value is NO_VALUE.

Parameters
bitrate: Int

The bitrate in bits per second.

Returns
VideoEncoderSettings.Builder!

This builder.

setBitrateMode

@CanIgnoreReturnValue
fun setBitrateMode(@VideoEncoderSettings.BitrateMode bitrateMode: Int): VideoEncoderSettings.Builder!

Sets bitrateMode. The default value is MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR.

Value must be in BitrateMode.

Parameters
@VideoEncoderSettings.BitrateMode bitrateMode: Int

The bitrateMode.

Returns
VideoEncoderSettings.Builder!

This builder.

setEncoderPerformanceParameters

@CanIgnoreReturnValue
fun setEncoderPerformanceParameters(operatingRate: Int, priority: Int): VideoEncoderSettings.Builder!

Sets encoding operating rate and priority. The default values are NO_VALUE, which is treated as configuring the encoder for maximum throughput.

To disable the configuration for either operating rate or priority, use RATE_UNSET for that argument.

Parameters
operatingRate: Int

The operating rate in frames per second.

priority: Int

The priority.

Returns
VideoEncoderSettings.Builder!

This builder.

setEncodingProfileLevel

@CanIgnoreReturnValue
fun setEncodingProfileLevel(encodingProfile: Int, encodingLevel: Int): VideoEncoderSettings.Builder!

Sets profile and level. The default values are both NO_VALUE.

The value must be one of the values defined in MediaCodecInfo.CodecProfileLevel, or NO_VALUE.

Profile settings will be ignored when using DefaultEncoderFactory and encoding to H264.

Parameters
encodingProfile: Int

The profile.

encodingLevel: Int

The level.

Returns
VideoEncoderSettings.Builder!

This builder.

setMaxBFrames

@CanIgnoreReturnValue
fun setMaxBFrames(maxBFrames: Int): VideoEncoderSettings.Builder!

Sets the maximum number of B frames allowed between I or P frames in the produced video. The default value is NO_VALUE which means that B frame encoding is disabled.

Parameters
maxBFrames: Int

the maximum number of B frames allowed.

Returns
VideoEncoderSettings.Builder!

This builder.

setRepeatPreviousFrameIntervalUs

@CanIgnoreReturnValue
fun setRepeatPreviousFrameIntervalUs(repeatPreviousFrameIntervalUs: Long): VideoEncoderSettings.Builder!

Sets the threshold duration between input frames beyond which to repeat the previous frame if no new frame has been received, in microseconds. The default value is NO_VALUE, which means that frames are not automatically repeated.

Parameters
repeatPreviousFrameIntervalUs: Long

The frame repeat interval, in microseconds.

Returns
VideoEncoderSettings.Builder!

This builder.

setTemporalLayers

@CanIgnoreReturnValue
fun setTemporalLayers(
    numNonBidirectionalLayers: Int,
    numBidirectionalLayers: Int
): VideoEncoderSettings.Builder!

Sets the number of temporal layers to request from the video encoder.

The default value for both parameters is NO_VALUE which indicates that no temporal layering schema will be set for the encoder.

Parameters
numNonBidirectionalLayers: Int

the number of predictive layers to have. This value must be stricly positive. A value of '0' explicitly requests no temporal layers from the encoder, regardless of the requested 'numBidirectionalLayers'.

numBidirectionalLayers: Int

the number of bi-directional layers to have. This value must be greater than or equal to zero. A value greater than 1 constructs a hierarchical-B coding structure.

Returns
VideoEncoderSettings.Builder!

This builder.

setiFrameIntervalSeconds

@CanIgnoreReturnValue
fun setiFrameIntervalSeconds(iFrameIntervalSeconds: Float): VideoEncoderSettings.Builder!

Sets iFrameIntervalSeconds. The default value is DEFAULT_I_FRAME_INTERVAL_SECONDS.

Parameters
iFrameIntervalSeconds: Float

The iFrameIntervalSeconds.

Returns
VideoEncoderSettings.Builder!

This builder.