io.agora.rtc

## Class VideoEncoderConfig

- java.lang.Object
- - io.agora.rtc.VideoEncoderConfig

-     public class VideoEncoderConfig
      extends java.lang.Object

  Configuration for video encoder.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `bitrate` Video encoding target bitrate (Kbps).
    `private int` | `codecType` The video encoder code type: #VIDEO_CODEC_TYPE.
    `private int` | `degradationPreference` The video degradation preference when the bandwidth is a constraint: #DEGRADATION_PREFERENCE.
    `private VideoDimensions` | `dimensions` The video frame dimension used to specify the video quality and measured by the total number of pixels along a frame's width and height: VideoDimensions.
    `private int` | `encodeAlpha` Whether to encode and send the alpha data to the remote when alpha data is present.
    `private int` | `frameRate` Frame rate of the video: int type, but can accept #FRAME_RATE for backward compatibility.
    `private int` | `minBitrate` (For future use) The minimum encoding bitrate (Kbps).
    `private int` | `mirrorMode` If mirror_type is set to VIDEO_MIRROR_MODE_ENABLED, then the video frame would be mirrored before encoding.
    `private int` | `orientationMode` (For future use) The video orientation mode of the video: #ORIENTATION_MODE.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VideoEncoderConfig()` Default constructor for VideoEncoderConfig.
    `VideoEncoderConfig(int codecType, VideoDimensions dimensions, int frameRate, int bitrate, int minBitrate, int orientationMode, int degradationPreference, int mirrorMode, int encodeAlpha)` Constructs VideoEncoderConfig with all parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getBitrate()` Gets the video encoding target bitrate (Kbps).
    `int` | `getCodecType()` Gets the video encoder codec type.
    `int` | `getDegradationPreference()` Gets the video degradation preference.
    `VideoDimensions` | `getDimensions()` Gets the video dimensions.
    `int` | `getEncodeAlpha()` Gets whether to encode alpha data.
    `int` | `getFrameRate()` Gets the frame rate.
    `int` | `getMinBitrate()` Gets the minimum encoding bitrate (Kbps).
    `int` | `getMirrorMode()` Gets the mirror mode.
    `int` | `getOrientationMode()` Gets the video orientation mode.
    `void` | `setBitrate(int bitrate)` Sets the video encoding target bitrate (Kbps).
    `void` | `setCodecType(int codecType)` Sets the video encoder codec type.
    `void` | `setDegradationPreference(int degradationPreference)` Sets the video degradation preference.
    `void` | `setDimensions(VideoDimensions dimensions)` Sets the video dimensions.
    `void` | `setEncodeAlpha(int encodeAlpha)` Sets whether to encode alpha data.
    `void` | `setFrameRate(int frameRate)` Sets the frame rate.
    `void` | `setMinBitrate(int minBitrate)` Sets the minimum encoding bitrate (Kbps).
    `void` | `setMirrorMode(int mirrorMode)` Sets the mirror mode.
    `void` | `setOrientationMode(int orientationMode)` Sets the video orientation mode.
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### codecType

          private int codecType

      The video encoder code type: #VIDEO_CODEC_TYPE.

    - #### dimensions

          private VideoDimensions dimensions

      The video frame dimension used to specify the video quality and measured by the total number of pixels along a frame's width and height: VideoDimensions.

    - #### frameRate

          private int frameRate

      Frame rate of the video: int type, but can accept #FRAME_RATE for backward compatibility.

    - #### bitrate

          private int bitrate

      Video encoding target bitrate (Kbps).

    - #### minBitrate

          private int minBitrate

      (For future use) The minimum encoding bitrate (Kbps). The Agora SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. That said, unless you have special requirements for image quality, Agora does not recommend changing this value. Important: This parameter applies to the Live Broadcast profile only.

    - #### orientationMode

          private int orientationMode

      (For future use) The video orientation mode of the video: #ORIENTATION_MODE.

    - #### degradationPreference

          private int degradationPreference

      The video degradation preference when the bandwidth is a constraint: #DEGRADATION_PREFERENCE. Currently, this member supports `MAINTAIN_QUALITY`(0) only.

    - #### mirrorMode

          private int mirrorMode

      If mirror_type is set to VIDEO_MIRROR_MODE_ENABLED, then the video frame would be mirrored before encoding.

    - #### encodeAlpha

          private int encodeAlpha

      Whether to encode and send the alpha data to the remote when alpha data is present. The default value is false.

  - ### Constructor Detail

    - #### VideoEncoderConfig

          public VideoEncoderConfig()

      Default constructor for VideoEncoderConfig.

    - #### VideoEncoderConfig

          public VideoEncoderConfig(int codecType,
                                    VideoDimensions dimensions,
                                    int frameRate,
                                    int bitrate,
                                    int minBitrate,
                                    int orientationMode,
                                    int degradationPreference,
                                    int mirrorMode,
                                    int encodeAlpha)

      Constructs VideoEncoderConfig with all parameters.
      Parameters:
        `codecType` - Video encoder codec type
        `dimensions` - Video dimensions
        `frameRate` - Frame rate
        `bitrate` - Video encoding target bitrate (Kbps)
        `minBitrate` - Minimum encoding bitrate (Kbps)
        `orientationMode` - Video orientation mode
        `degradationPreference` - Video degradation preference
        `mirrorMode` - Mirror mode
        `encodeAlpha` - Whether to encode alpha data

  - ### Method Detail

    - #### getCodecType

          public int getCodecType()

      Gets the video encoder codec type.
      Returns:
        Video encoder codec type

    - #### setCodecType

          public void setCodecType(int codecType)

      Sets the video encoder codec type.
      Parameters:
        `codecType` - Video encoder codec type

    - #### getDimensions

          public VideoDimensions getDimensions()

      Gets the video dimensions.
      Returns:
        Video dimensions

    - #### setDimensions

          public void setDimensions(VideoDimensions dimensions)

      Sets the video dimensions.
      Parameters:
        `dimensions` - Video dimensions

    - #### getFrameRate

          public int getFrameRate()

      Gets the frame rate.
      Returns:
        Frame rate

    - #### setFrameRate

          public void setFrameRate(int frameRate)

      Sets the frame rate.
      Parameters:
        `frameRate` - Frame rate

    - #### getBitrate

          public int getBitrate()

      Gets the video encoding target bitrate (Kbps).
      Returns:
        Video encoding target bitrate (Kbps)

    - #### setBitrate

          public void setBitrate(int bitrate)

      Sets the video encoding target bitrate (Kbps).
      Parameters:
        `bitrate` - Video encoding target bitrate (Kbps)

    - #### getMinBitrate

          public int getMinBitrate()

      Gets the minimum encoding bitrate (Kbps).
      Returns:
        Minimum encoding bitrate (Kbps)

    - #### setMinBitrate

          public void setMinBitrate(int minBitrate)

      Sets the minimum encoding bitrate (Kbps).
      Parameters:
        `minBitrate` - Minimum encoding bitrate (Kbps)

    - #### getOrientationMode

          public int getOrientationMode()

      Gets the video orientation mode.
      Returns:
        Video orientation mode

    - #### setOrientationMode

          public void setOrientationMode(int orientationMode)

      Sets the video orientation mode.
      Parameters:
        `orientationMode` - Video orientation mode

    - #### getDegradationPreference

          public int getDegradationPreference()

      Gets the video degradation preference.
      Returns:
        Video degradation preference

    - #### setDegradationPreference

          public void setDegradationPreference(int degradationPreference)

      Sets the video degradation preference.
      Parameters:
        `degradationPreference` - Video degradation preference

    - #### getMirrorMode

          public int getMirrorMode()

      Gets the mirror mode.
      Returns:
        Mirror mode

    - #### setMirrorMode

          public void setMirrorMode(int mirrorMode)

      Sets the mirror mode.
      Parameters:
        `mirrorMode` - Mirror mode

    - #### getEncodeAlpha

          public int getEncodeAlpha()

      Gets whether to encode alpha data.
      Returns:
        1 to encode alpha data, 0 otherwise

    - #### setEncodeAlpha

          public void setEncodeAlpha(int encodeAlpha)

      Sets whether to encode alpha data.
      Parameters:
        `encodeAlpha` - 1 to encode alpha data, 0 otherwise

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`