VideoEncoderConstraints


@ExperimentalApi
class VideoEncoderConstraints


Immutable set of user-provided constraints that CodecDB can optimize around.

VideoEncoderConstraintsPresets provides instances with presets for common encoding use cases. Callers can override individual constraints via buildUpon.

Summary

Nested types

Builder for VideoEncoderConstraints instances.

Constants

const Int

Target quality level representing acceptable quality (VMAF 76).

const Int

Target quality level representing good quality (VMAF 82).

const Int

Target quality level representing the minimum recommended quality (VMAF 70).

const Int

Target quality level representing near-lossless quality (VMAF 94).

const Int

Target quality level representing very good quality (VMAF 88).

Public functions

VideoEncoderConstraints.Builder!

Returns a Builder initialized with the values of this instance.

Boolean
equals(o: Any?)
Int
String!

Public properties

Int

The set of C.VideoCodecFlags that are allowed.

Boolean

Whether B-frames are allowed for the content to be encoded.

Int

The bit depth of the content to be encoded.

Int

The required bitrate mode for the encoder.

Double

The user-specified frame rate of the content to be encoded in frames per second.

Int

The user-specified height of the content to be encoded in pixels.

Float

The desired key-frame interval to be set in the encoder, in seconds.

Int

The maximum bitrate in bits per second, or NO_VALUE if unset.

Double

The target quality as a VMAF score in (0, 100], or NO_VALUE if unset.

Int

The user-specified width of the content to be encoded in pixels.

Constants

QUALITY_LEVEL_ACCEPTABLE

const val QUALITY_LEVEL_ACCEPTABLE = 76: Int

Target quality level representing acceptable quality (VMAF 76).

Recommended when bitrate or file size is a concern.

QUALITY_LEVEL_GOOD

const val QUALITY_LEVEL_GOOD = 82: Int

Target quality level representing good quality (VMAF 82).

Recommended for content exported to the device gallery or high-quality social media uploads.

QUALITY_LEVEL_MINIMUM

const val QUALITY_LEVEL_MINIMUM = 70: Int

Target quality level representing the minimum recommended quality (VMAF 70).

Use this level only when bitrate is constrained.

QUALITY_LEVEL_NEAR_LOSSLESS

const val QUALITY_LEVEL_NEAR_LOSSLESS = 94: Int

Target quality level representing near-lossless quality (VMAF 94).

Recommended for camera capture or archival.

QUALITY_LEVEL_VERY_GOOD

const val QUALITY_LEVEL_VERY_GOOD = 88: Int

Target quality level representing very good quality (VMAF 88).

Balances visual fidelity and file size.

Public functions

buildUpon

fun buildUpon(): VideoEncoderConstraints.Builder!

Returns a Builder initialized with the values of this instance.

equals

fun equals(o: Any?): Boolean

hashCode

fun hashCode(): Int

toString

fun toString(): String!

Public properties

allowedCodecs

@C.VideoCodecFlags
val allowedCodecs: Int

The set of C.VideoCodecFlags that are allowed.

bFramesAllowed

val bFramesAllowed: Boolean

Whether B-frames are allowed for the content to be encoded.

bitDepth

val bitDepth: Int

The bit depth of the content to be encoded.

bitrateMode

@VideoEncoderSettings.BitrateMode
val bitrateMode: Int

The required bitrate mode for the encoder.

frameRate

val frameRate: Double

The user-specified frame rate of the content to be encoded in frames per second.

height

val height: Int

The user-specified height of the content to be encoded in pixels.

keyFrameIntervalSeconds

val keyFrameIntervalSeconds: Float

The desired key-frame interval to be set in the encoder, in seconds.

maxBitrate

val maxBitrate: Int

The maximum bitrate in bits per second, or NO_VALUE if unset.

Exactly one of targetQuality and maxBitrate is set.

targetQuality

val targetQuality: Double

The target quality as a VMAF score in (0, 100], or NO_VALUE if unset.

Exactly one of targetQuality and maxBitrate is set.

width

val width: Int

The user-specified width of the content to be encoded in pixels.