Class VideoEncoderSettings.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.transformer.VideoEncoderSettings.Builder
-
- Enclosing class:
- VideoEncoderSettings
public static final class VideoEncoderSettings.Builder extends Object
BuildsVideoEncoderSettings
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VideoEncoderSettings
build()
Builds the instance.VideoEncoderSettings.Builder
experimentalSetEnableHighQualityTargeting(boolean enableHighQualityTargeting)
Sets whether to enable automatic adjustment of the bitrate to target a high quality encoding.VideoEncoderSettings.Builder
setBitrate(int bitrate)
VideoEncoderSettings.Builder
setBitrateMode(@com.google.android.exoplayer2.transformer.VideoEncoderSettings.BitrateMode int bitrateMode)
VideoEncoderSettings.Builder
setEncoderPerformanceParameters(int operatingRate, int priority)
Sets encoding operating rate and priority.VideoEncoderSettings.Builder
setEncodingProfileLevel(int encodingProfile, int encodingLevel)
VideoEncoderSettings.Builder
setiFrameIntervalSeconds(float iFrameIntervalSeconds)
-
-
-
Method Detail
-
setBitrate
@CanIgnoreReturnValue public VideoEncoderSettings.Builder setBitrate(int bitrate)
SetsVideoEncoderSettings.bitrate
. The default value isVideoEncoderSettings.NO_VALUE
.Can not be set if enabling
experimentalSetEnableHighQualityTargeting(boolean)
.- Parameters:
bitrate
- TheVideoEncoderSettings.bitrate
in bits per second.- Returns:
- This builder.
-
setBitrateMode
@CanIgnoreReturnValue public VideoEncoderSettings.Builder setBitrateMode(@com.google.android.exoplayer2.transformer.VideoEncoderSettings.BitrateMode int bitrateMode)
SetsVideoEncoderSettings.bitrateMode
. The default value isMediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR
.Value must be in
VideoEncoderSettings.BitrateMode
.- Parameters:
bitrateMode
- TheVideoEncoderSettings.bitrateMode
.- Returns:
- This builder.
-
setEncodingProfileLevel
@CanIgnoreReturnValue public VideoEncoderSettings.Builder setEncodingProfileLevel(int encodingProfile, int encodingLevel)
SetsVideoEncoderSettings.profile
andVideoEncoderSettings.level
. The default values are bothVideoEncoderSettings.NO_VALUE
.The value must be one of the values defined in
MediaCodecInfo.CodecProfileLevel
, orVideoEncoderSettings.NO_VALUE
.Profile and level settings will be ignored when using
DefaultEncoderFactory
and encoding to H264.- Parameters:
encodingProfile
- TheVideoEncoderSettings.profile
.encodingLevel
- TheVideoEncoderSettings.level
.- Returns:
- This builder.
-
setiFrameIntervalSeconds
@CanIgnoreReturnValue public VideoEncoderSettings.Builder setiFrameIntervalSeconds(float iFrameIntervalSeconds)
SetsVideoEncoderSettings.iFrameIntervalSeconds
. The default value isVideoEncoderSettings.DEFAULT_I_FRAME_INTERVAL_SECONDS
.- Parameters:
iFrameIntervalSeconds
- TheVideoEncoderSettings.iFrameIntervalSeconds
.- Returns:
- This builder.
-
setEncoderPerformanceParameters
@CanIgnoreReturnValue public VideoEncoderSettings.Builder setEncoderPerformanceParameters(int operatingRate, int priority)
Sets encoding operating rate and priority. The default values areVideoEncoderSettings.NO_VALUE
, which is treated as configuring the encoder for maximum throughput.- Parameters:
operatingRate
- Theoperating rate
in frames per second.priority
- Thepriority
.- Returns:
- This builder.
-
experimentalSetEnableHighQualityTargeting
@CanIgnoreReturnValue public VideoEncoderSettings.Builder experimentalSetEnableHighQualityTargeting(boolean enableHighQualityTargeting)
Sets whether to enable automatic adjustment of the bitrate to target a high quality encoding.This method is experimental and may be removed or changed without warning.
Default value is
false
.Requires
MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR
.Can not be enabled alongside setting a custom bitrate with
setBitrate(int)
.
-
build
public VideoEncoderSettings build()
Builds the instance.
-
-