VideoEncoderSettings.Builder
public final class VideoEncoderSettings.Builder
Builds VideoEncoderSettings instances.
Summary
Public constructors |
|---|
Builder()Creates a new instance. |
Public methods |
|
|---|---|
VideoEncoderSettings |
build()Builds the instance. |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValueSets |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValueSets |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValueSets encoding operating rate and priority. |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValue |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValueSets the maximum number of B frames allowed between I or P frames in the produced video. |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValueSets the threshold duration between input frames beyond which to repeat the previous frame if no new frame has been received, in microseconds. |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValueSets the number of temporal layers to request from the video encoder. |
VideoEncoderSettings.Builder |
@CanIgnoreReturnValueSets |
Public constructors
Public methods
setBitrate
@CanIgnoreReturnValue
public VideoEncoderSettings.Builder setBitrate(int bitrate)
Sets bitrate. The default value is NO_VALUE.
| Parameters | |
|---|---|
int bitrate |
The |
| Returns | |
|---|---|
VideoEncoderSettings.Builder |
This builder. |
setBitrateMode
@CanIgnoreReturnValue
public VideoEncoderSettings.Builder setBitrateMode(@VideoEncoderSettings.BitrateMode int bitrateMode)
Sets bitrateMode. The default value is
MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR.
Value must be in BitrateMode.
| Parameters | |
|---|---|
@VideoEncoderSettings.BitrateMode int bitrateMode |
The |
| Returns | |
|---|---|
VideoEncoderSettings.Builder |
This builder. |
setEncoderPerformanceParameters
@CanIgnoreReturnValue
public VideoEncoderSettings.Builder setEncoderPerformanceParameters(int operatingRate, int priority)
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 | |
|---|---|
int operatingRate |
The |
int priority |
The |
| Returns | |
|---|---|
VideoEncoderSettings.Builder |
This builder. |
setEncodingProfileLevel
@CanIgnoreReturnValue
public VideoEncoderSettings.Builder setEncodingProfileLevel(int encodingProfile, int encodingLevel)
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.
| Returns | |
|---|---|
VideoEncoderSettings.Builder |
This builder. |
setMaxBFrames
@CanIgnoreReturnValue
public VideoEncoderSettings.Builder setMaxBFrames(int maxBFrames)
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 | |
|---|---|
int maxBFrames |
the |
| Returns | |
|---|---|
VideoEncoderSettings.Builder |
This builder. |
setRepeatPreviousFrameIntervalUs
@CanIgnoreReturnValue
public VideoEncoderSettings.Builder setRepeatPreviousFrameIntervalUs(long repeatPreviousFrameIntervalUs)
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 | |
|---|---|
long repeatPreviousFrameIntervalUs |
The |
| Returns | |
|---|---|
VideoEncoderSettings.Builder |
This builder. |
setTemporalLayers
@CanIgnoreReturnValue
public VideoEncoderSettings.Builder setTemporalLayers(
int numNonBidirectionalLayers,
int numBidirectionalLayers
)
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 | |
|---|---|
int numNonBidirectionalLayers |
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'. |
int numBidirectionalLayers |
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
public VideoEncoderSettings.Builder setiFrameIntervalSeconds(float iFrameIntervalSeconds)
Sets iFrameIntervalSeconds. The default value is DEFAULT_I_FRAME_INTERVAL_SECONDS.
| Parameters | |
|---|---|
float iFrameIntervalSeconds |
| Returns | |
|---|---|
VideoEncoderSettings.Builder |
This builder. |