Agora Java API Reference for Android

Public Member Functions | Public Attributes | List of all members
agora::rtc::VideoEncoderConfiguration Struct Reference

`#include <AgoraBase.h>`

## Public Member Functions
| VideoEncoderConfiguration (const VideoDimensions &d, int f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mirror=VIDEO_MIRROR_MODE_DISABLED)
| VideoEncoderConfiguration (int width, int height, int f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mirror=VIDEO_MIRROR_MODE_DISABLED)
| VideoEncoderConfiguration (const VideoEncoderConfiguration &config)
VideoEncoderConfiguration & | operator= (const VideoEncoderConfiguration &rhs)

## Public Attributes
VIDEO_CODEC_TYPE | codecType
VideoDimensions | dimensions
int | frameRate
int | bitrate
int | minBitrate
ORIENTATION_MODE | orientationMode
DEGRADATION_PREFERENCE | degradationPreference
VIDEO_MIRROR_MODE_TYPE | mirrorMode
AdvanceOptions | advanceOptions

## Detailed Description

The definition of the VideoEncoderConfiguration struct.

## Member Data Documentation

## ◆ codecType

VIDEO_CODEC_TYPE agora::rtc::VideoEncoderConfiguration::codecType

The video encoder code type: #VIDEO_CODEC_TYPE.

## ◆ dimensions

VideoDimensions agora::rtc::VideoEncoderConfiguration::dimensions

The video dimension: VideoDimensions.

## ◆ frameRate

int agora::rtc::VideoEncoderConfiguration::frameRate

The frame rate of the video. You can set it manually, or choose one from #FRAME_RATE.

## ◆ bitrate

int agora::rtc::VideoEncoderConfiguration::bitrate

The bitrate (Kbps) of the video.

Refer to the Video Bitrate Table below and set your bitrate. If you set a bitrate beyond the proper range, the SDK automatically adjusts it to a value within the range. You can also choose from the following options:

- #STANDARD_BITRATE: (Recommended) Standard bitrate mode. In this mode, the bitrates differ between the Live Broadcast and Communication profiles:
  - In the Communication profile, the video bitrate is the same as the base bitrate.
  - In the Live Broadcast profile, the video bitrate is twice the base bitrate.
- #COMPATIBLE_BITRATE: Compatible bitrate mode. The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. If you choose this mode for the Live Broadcast profile, the video frame rate may be lower than the set value.

Agora uses different video codecs for different profiles to optimize the user experience. For example, the communication profile prioritizes the smoothness while the live-broadcast profile prioritizes the video quality (a higher bitrate). Therefore, We recommend setting this parameter as #STANDARD_BITRATE.

Resolution | Frame Rate (fps) | Base Bitrate (Kbps) | Live Bitrate (Kbps)
--- | --- | --- | ---
160 * 120 | 15 | 65 | 110
120 * 120 | 15 | 50 | 90
320 * 180 | 15 | 140 | 240
180 * 180 | 15 | 100 | 160
240 * 180 | 15 | 120 | 200
320 * 240 | 15 | 200 | 300
240 * 240 | 15 | 140 | 240
424 * 240 | 15 | 220 | 370
640 * 360 | 15 | 400 | 680
360 * 360 | 15 | 260 | 440
640 * 360 | 30 | 600 | 1030
360 * 360 | 30 | 400 | 670
480 * 360 | 15 | 320 | 550
480 * 360 | 30 | 490 | 830
640 * 480 | 15 | 500 | 750
480 * 480 | 15 | 400 | 680
640 * 480 | 30 | 750 | 1130
480 * 480 | 30 | 600 | 1030
848 * 480 | 15 | 610 | 920
848 * 480 | 30 | 930 | 1400
640 * 480 | 10 | 400 | 600
960 * 540 | 15 | 750 | 1100
960 * 540 | 30 | 1110 | 1670
1280 * 720 | 15 | 1130 | 1600
1280 * 720 | 30 | 1710 | 2400
960 * 720 | 15 | 910 | 1280
960 * 720 | 30 | 1380 | 2000
1920 * 1080 | 15 | 2080 | 2500
1920 * 1080 | 30 | 3150 | 3780
1920 * 1080 | 60 | 4780 | 5730
2560 * 1440 | 30 | 4850 | 4850
2560 * 1440 | 60 | 7350 | 7350
3840 * 2160 | 30 | 8910 | 8910
3840 * 2160 | 60 | 13500 | 13500

## ◆ minBitrate

int agora::rtc::VideoEncoderConfiguration::minBitrate

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.

Note
  This parameter applies to the live-broadcast profile only.

## ◆ orientationMode

ORIENTATION_MODE agora::rtc::VideoEncoderConfiguration::orientationMode

The video orientation mode: #ORIENTATION_MODE.

## ◆ degradationPreference

DEGRADATION_PREFERENCE agora::rtc::VideoEncoderConfiguration::degradationPreference

The video degradation preference under limited bandwidth: #DEGRADATION_PREFERENCE.

## ◆ mirrorMode

VIDEO_MIRROR_MODE_TYPE agora::rtc::VideoEncoderConfiguration::mirrorMode

The mirror mode is disabled by default If mirror_type is set to VIDEO_MIRROR_MODE_ENABLED, then the video frame would be mirrored before encoding.

## ◆ advanceOptions

AdvanceOptions agora::rtc::VideoEncoderConfiguration::advanceOptions

The advanced options for the video encoder configuration. See AdvanceOptions.