Package io.agora.rtc2.video
Class VideoEncoderConfiguration
java.lang.Object
io.agora.rtc2.video.VideoEncoderConfiguration
The video encoder configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe video advanceoptions.static enumSupported codec type bit mask.static enumVideo COMPRESSION PREFERENCE.static enumThe video encoding degradation preference under limited bandwidth.static enumThe Video encoder type preference.static enumThe frame rate of the video.static enumVideo mirror mode types.static enumThe video orientation mode of the video.static enumVideo code types.static classThe video dimensions. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe video hardwareEncoding: #hardwareEncoding and The video compressionPreference: #compressionPreference.intThe bitrate of the video (Kbps).The codec type of the local video stream.static final int-1: The compatible bitrate mode.static final int(For future use) Use the default minimum bitrate.static final int-2: (For future use) Set minimum bitrate the same as target bitrate.static final int(For future use) The default minimum frame rate.The video encoding degradation preference under limited bandwidth:DEGRADATION_PREFERENCE.The video frame dimensions (px), which is used to specify the video quality and measured by the total number of pixels along a frame's width and height.intThe video frame rate (fps).int(For future use) The minimum encoding bitrate (Kbps).int(For future use) The minimum video encoder frame rate (fps).If mirror_type is set to VIDEO_MIRROR_MODE_ENABLED, then the video frame would be mirrored before encoding.The orientation mode.static final int0: The standard bitrate mode.static final VideoEncoderConfiguration.VideoDimensionsVD_120x120: The video resolution is 120 × 120.static final VideoEncoderConfiguration.VideoDimensionsVD_1280x720: The video resolution is 640 × 360.static final VideoEncoderConfiguration.VideoDimensionsVD_160x120: The video resolution is 160 × 120.static final VideoEncoderConfiguration.VideoDimensionsVD_180x180: The video resolution is 180 × 180.static final VideoEncoderConfiguration.VideoDimensionsNot supported.static final VideoEncoderConfiguration.VideoDimensionsVD_240x180: The video resolution is 240 × 180.static final VideoEncoderConfiguration.VideoDimensionsVD_240x240: The video resolution is 240 × 240.static final VideoEncoderConfiguration.VideoDimensionsNot supported.static final VideoEncoderConfiguration.VideoDimensionsVD_320x180: The video resolution is 320 × 180.static final VideoEncoderConfiguration.VideoDimensionsVD_320x240: The video resolution is 320 × 240.static final VideoEncoderConfiguration.VideoDimensionsVD_360x360: The video resolution is 360 × 360.static final VideoEncoderConfiguration.VideoDimensionsNot supported.static final VideoEncoderConfiguration.VideoDimensionsVD_424x240: The video resolution is 424 × 240.static final VideoEncoderConfiguration.VideoDimensionsVD_480x360: The video resolution is 480 × 360.static final VideoEncoderConfiguration.VideoDimensionsVD_480x480: The video resolution is 480 × 480.static final VideoEncoderConfiguration.VideoDimensionsVD_640x360: The video resolution is 640 × 360.static final VideoEncoderConfiguration.VideoDimensionsVD_640x480: The video resolution is 640 × 480.static final VideoEncoderConfiguration.VideoDimensionsVD_840x480: The video resolution is 840 × 480.static final VideoEncoderConfiguration.VideoDimensionsVD_960x540: The video resolution is 960 × 540.static final VideoEncoderConfiguration.VideoDimensionsVD_960x720: The video resolution is 640 × 360. -
Constructor Summary
ConstructorsConstructorDescriptionVideoEncoderConfiguration(int width, int height, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode) VideoEncoderConfiguration(int width, int height, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode, VideoEncoderConfiguration.MIRROR_MODE_TYPE mirrorMode) VideoEncoderConfiguration(VideoEncoderConfiguration.VideoDimensions dimensions, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode) VideoEncoderConfiguration(VideoEncoderConfiguration.VideoDimensions dimensions, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode, VideoEncoderConfiguration.MIRROR_MODE_TYPE mirrorMode) -
Method Summary
-
Field Details
-
VD_120x120
VD_120x120: The video resolution is 120 × 120. -
VD_160x120
VD_160x120: The video resolution is 160 × 120. -
VD_180x180
VD_180x180: The video resolution is 180 × 180. -
VD_240x180
VD_240x180: The video resolution is 240 × 180. -
VD_320x180
VD_320x180: The video resolution is 320 × 180. -
VD_240x240
VD_240x240: The video resolution is 240 × 240. -
VD_320x240
VD_320x240: The video resolution is 320 × 240. -
VD_424x240
VD_424x240: The video resolution is 424 × 240. -
VD_360x360
VD_360x360: The video resolution is 360 × 360. -
VD_480x360
VD_480x360: The video resolution is 480 × 360. -
VD_640x360
VD_640x360: The video resolution is 640 × 360. -
VD_480x480
VD_480x480: The video resolution is 480 × 480. -
VD_640x480
VD_640x480: The video resolution is 640 × 480. -
VD_840x480
VD_840x480: The video resolution is 840 × 480. -
VD_960x540
VD_960x540: The video resolution is 960 × 540. -
VD_960x720
VD_960x720: The video resolution is 640 × 360. -
VD_1280x720
VD_1280x720: The video resolution is 640 × 360. -
VD_1920x1080
Not supported. -
VD_2540x1440
Not supported. -
VD_3840x2160
Not supported. -
STANDARD_BITRATE
public static final int STANDARD_BITRATE0: The standard bitrate mode. In this mode, the bitrates under the Live Broadcast and Communication profiles differ: - 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.- See Also:
-
COMPATIBLE_BITRATE
public static final int COMPATIBLE_BITRATE-1: 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.- See Also:
-
DEFAULT_MIN_BITRATE
public static final int DEFAULT_MIN_BITRATE(For future use) Use the default minimum bitrate.- See Also:
-
DEFAULT_MIN_FRAMERATE
public static final int DEFAULT_MIN_FRAMERATE(For future use) The default minimum frame rate.- See Also:
-
DEFAULT_MIN_BITRATE_EQUAL_TO_TARGET_BITRATE
public static final int DEFAULT_MIN_BITRATE_EQUAL_TO_TARGET_BITRATE-2: (For future use) Set minimum bitrate the same as target bitrate.- See Also:
-
dimensions
The video frame dimensions (px), which is used to specify the video quality and measured by the total number of pixels along a frame's width and height. The default value is 960 × 540. Users can either set the resolution manually or choose from the following options: -VD_120x120. -VD_160x120. -VD_180x180. -VD_240x180. -VD_320x180. -VD_240x240. -VD_320x240. -VD_424x240. -VD_360x360. -VD_480x360. -VD_640x360. -VD_480x480. -VD_640x480. -VD_840x480. -VD_960x540. -VD_960x720. -VD_1280x720. -
frameRate
public int frameRateThe video frame rate (fps). The default value is 15. Users can either set the frame rate manually or choose from the following options. We do not recommend setting this to a value greater than 30. -FRAME_RATE_FPS_1(1). -FRAME_RATE_FPS_7(7). -FRAME_RATE_FPS_10(10). -FRAME_RATE_FPS_15(15). -FRAME_RATE_FPS_24(24). -FRAME_RATE_FPS_30(30). -FRAME_RATE_FPS_60(60). -
minFrameRate
public int minFrameRate(For future use) The minimum video encoder frame rate (fps). The default value isDEFAULT_MIN_FRAMERATE(-1)(the SDK uses the lowest encoder frame rate). -
bitrate
public int bitrateThe bitrate of the video (Kbps). Refer to the 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(0): (Recommended) The 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(-1): 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 asSTANDARD_BITRATE = 0. **Video Bitrate Table**Resolution Frame rate(fps) Maximum Bitrate (Kbps) 120 × 120 15 150 120 × 160 15 186 180 × 180 15 270 180 × 240 15 336 180 × 320 15 420 240 × 240 15 420 240 × 320 15 522 240 × 424 15 648 360 × 360 15 774 360 × 360 30 1162 360 × 480 15 966 360 × 480 30 1407 360 × 640 15 1200 360 × 640 30 1696 480 × 480 15 1200 480 × 480 30 1696 480 × 640 10 1164 480 × 640 15 1445 480 × 640 30 2041 480 × 848 15 1735 480 × 848 30 2445 540 × 960 15 2029 540 × 960 30 2852 720 × 960 15 2443 720 × 960 30 3434 720 × 1280 15 2938 720 × 1280 30 4113 1080 × 1920 15 4914 1080 × 1920 30 6819 1080 × 1920 60 9380 2560 × 1440 15 7040 2560 × 1440 30 9700 2560 × 1440 60 13230 3840 × 2160 15 11550 3840 × 2160 30 15726 3840 × 2160 60 21133 -
minBitrate
public 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. -
orientationMode
The orientation mode. SeeORIENTATION_MODE. -
degradationPrefer
The video encoding degradation preference under limited bandwidth:DEGRADATION_PREFERENCE. -
mirrorMode
If mirror_type is set to VIDEO_MIRROR_MODE_ENABLED, then the video frame would be mirrored before encoding. -
advanceOptions
The video hardwareEncoding: #hardwareEncoding and The video compressionPreference: #compressionPreference. -
codecType
The codec type of the local video stream. See #VIDEO_CODEC_TYPE. The default value is `VIDEO_CODEC_H265 (3)`.
-
-
Constructor Details
-
VideoEncoderConfiguration
public VideoEncoderConfiguration() -
VideoEncoderConfiguration
public VideoEncoderConfiguration(VideoEncoderConfiguration.VideoDimensions dimensions, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode) -
VideoEncoderConfiguration
public VideoEncoderConfiguration(VideoEncoderConfiguration.VideoDimensions dimensions, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode, VideoEncoderConfiguration.MIRROR_MODE_TYPE mirrorMode) -
VideoEncoderConfiguration
public VideoEncoderConfiguration(int width, int height, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode) -
VideoEncoderConfiguration
public VideoEncoderConfiguration(int width, int height, VideoEncoderConfiguration.FRAME_RATE frameRate, int bitrate, VideoEncoderConfiguration.ORIENTATION_MODE orientationMode, VideoEncoderConfiguration.MIRROR_MODE_TYPE mirrorMode)
-