Package com.google.android.exoplayer2.transformer

## Class VideoEncoderSettings.Builder

- java.lang.Object
- - com.google.android.exoplayer2.transformer.VideoEncoderSettings.Builder

- Enclosing class:
    VideoEncoderSettings

      public static final class VideoEncoderSettings.Builder
      extends Object

  Builds `VideoEncoderSettings` 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` | `setBitrate​(int bitrate)` | Sets `VideoEncoderSettings.bitrate`.
    `VideoEncoderSettings.Builder` | `setBitrateMode​(@com.google.android.exoplayer2.transformer.VideoEncoderSettings.BitrateMode int bitrateMode)` | Sets `VideoEncoderSettings.bitrateMode`.
    `VideoEncoderSettings.Builder` | `setEnableHighQualityTargeting​(boolean enableHighQualityTargeting)` | Sets whether to enable automatic adjustment of the bitrate to target a high quality encoding.
    `VideoEncoderSettings.Builder` | `setEncoderPerformanceParameters​(int operatingRate, int priority)` | Sets encoding operating rate and priority.
    `VideoEncoderSettings.Builder` | `setEncodingProfileLevel​(int encodingProfile, int encodingLevel)` | Sets `VideoEncoderSettings.profile` and `VideoEncoderSettings.level`.
    `VideoEncoderSettings.Builder` | `setiFrameIntervalSeconds​(float iFrameIntervalSeconds)` | Sets `VideoEncoderSettings.iFrameIntervalSeconds`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder()

      Creates a new instance.

  - ### Method Detail

    - #### setBitrate

          @CanIgnoreReturnValue
          public VideoEncoderSettings.Builder setBitrate​(int bitrate)

      Sets `VideoEncoderSettings.bitrate`. The default value is `VideoEncoderSettings.NO_VALUE`.

      Can not be set if enabling `setEnableHighQualityTargeting(boolean)`.

      Parameters:
        `bitrate` - The `VideoEncoderSettings.bitrate`.
      Returns:
        This builder.

    - #### setBitrateMode

          @CanIgnoreReturnValue
          public VideoEncoderSettings.Builder setBitrateMode​(@com.google.android.exoplayer2.transformer.VideoEncoderSettings.BitrateMode int bitrateMode)

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

      Value must be in `VideoEncoderSettings.BitrateMode`.

      Parameters:
        `bitrateMode` - The `VideoEncoderSettings.bitrateMode`.
      Returns:
        This builder.

    - #### setEncodingProfileLevel

          @CanIgnoreReturnValue
          public VideoEncoderSettings.Builder setEncodingProfileLevel​(int encodingProfile,
                                                                      int encodingLevel)

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

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

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

      Parameters:
        `encodingProfile` - The `VideoEncoderSettings.profile`.
        `encodingLevel` - The `VideoEncoderSettings.level`.
      Returns:
        This builder.

    - #### setiFrameIntervalSeconds

          @CanIgnoreReturnValue
          public VideoEncoderSettings.Builder setiFrameIntervalSeconds​(float iFrameIntervalSeconds)

      Sets `VideoEncoderSettings.iFrameIntervalSeconds`. The default value is `VideoEncoderSettings.DEFAULT_I_FRAME_INTERVAL_SECONDS`.
      Parameters:
        `iFrameIntervalSeconds` - The `VideoEncoderSettings.iFrameIntervalSeconds`.
      Returns:
        This builder.

    - #### setEncoderPerformanceParameters

          @CanIgnoreReturnValue
          public VideoEncoderSettings.Builder setEncoderPerformanceParameters​(int operatingRate,
                                                                              int priority)

      Sets encoding operating rate and priority. The default values are `VideoEncoderSettings.NO_VALUE`, which is treated as configuring the encoder for maximum throughput.
      Parameters:
        `operatingRate` - The `operating rate`.
        `priority` - The `priority`.
      Returns:
        This builder.

    - #### setEnableHighQualityTargeting

          @CanIgnoreReturnValue
          public VideoEncoderSettings.Builder setEnableHighQualityTargeting​(boolean enableHighQualityTargeting)

      Sets whether to enable automatic adjustment of the bitrate to target a high quality encoding.

      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.