FVideoEncoderConfiguration

Video encoder configurations.

USTRUCT(BlueprintType)
struct FVideoEncoderConfiguration
{
	GENERATED_BODY()
public:
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	EVIDEO_CODEC_TYPE codecType = EVIDEO_CODEC_TYPE::VIDEO_CODEC_NONE;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	FVideoDimensions dimensions = FVideoDimensions();
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	int frameRate = 15;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	int bitrate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	int minBitrate = -1;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	EORIENTATION_MODE orientationMode = EORIENTATION_MODE::ORIENTATION_MODE_ADAPTIVE;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	EDEGRADATION_PREFERENCE degradationPreference = EDEGRADATION_PREFERENCE::MAINTAIN_QUALITY;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	EVIDEO_MIRROR_MODE_TYPE mirrorMode = EVIDEO_MIRROR_MODE_TYPE::VIDEO_MIRROR_MODE_DISABLED;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|VideoEncoderConfiguration")
	FAdvanceOptions advanceOptions = FAdvanceOptions();
	FVideoEncoderConfiguration(){}
	FVideoEncoderConfiguration(const agora::rtc::VideoEncoderConfiguration & AgoraData){
		codecType = static_cast<EVIDEO_CODEC_TYPE>(AgoraData.codecType);
		dimensions = FVideoDimensions(AgoraData.dimensions);
		frameRate = AgoraData.frameRate;
		bitrate = AgoraData.bitrate;
		minBitrate = AgoraData.minBitrate;
		orientationMode = static_cast<EORIENTATION_MODE>(AgoraData.orientationMode);
		degradationPreference = static_cast<EDEGRADATION_PREFERENCE>(AgoraData.degradationPreference);
		mirrorMode = static_cast<EVIDEO_MIRROR_MODE_TYPE>(AgoraData.mirrorMode);
		advanceOptions = FAdvanceOptions(AgoraData.advanceOptions);
	}
	agora::rtc::VideoEncoderConfiguration CreateAgoraData() const {
		agora::rtc::VideoEncoderConfiguration AgoraData;
		AgoraData.codecType = static_cast<agora::rtc::VIDEO_CODEC_TYPE>(codecType);
		AgoraData.dimensions = dimensions.CreateAgoraData();
		AgoraData.frameRate = frameRate;
		AgoraData.bitrate = bitrate;
		AgoraData.minBitrate = minBitrate;
		AgoraData.orientationMode = static_cast<agora::rtc::ORIENTATION_MODE>(orientationMode);
		AgoraData.degradationPreference = static_cast<agora::rtc::DEGRADATION_PREFERENCE>(degradationPreference);
		AgoraData.mirrorMode = static_cast<agora::rtc::VIDEO_MIRROR_MODE_TYPE>(mirrorMode);
		AgoraData.advanceOptions = advanceOptions.CreateAgoraData();
		return AgoraData;
	}
	void FreeAgoraData(agora::rtc::VideoEncoderConfiguration& AgoraData) const {
		dimensions.FreeAgoraData(AgoraData.dimensions);
		advanceOptions.FreeAgoraData(AgoraData.advanceOptions);
	}
};

Attributes

dimensions

The dimensions of the encoded video (px). See FVideoDimensions. This parameter measures the video encoding quality in the format of length × width. The default value is 960 × 540. You can set a custom value.

codecType
The codec type of the local video stream. See EVIDEO_CODEC_TYPE.
frameRate
The frame rate (fps) of the encoding video frame. The default value is 15.
  • FRAME_RATE_FPS_1(1): 1 fps.
  • FRAME_RATE_FPS_7(7): 7 fps.
  • FRAME_RATE_FPS_10(10): 10 fps.
  • FRAME_RATE_FPS_15(15): 15 fps.
  • FRAME_RATE_FPS_24(24): 24 fps.
  • FRAME_RATE_FPS_30(30): 30 fps.
  • FRAME_RATE_FPS_60(60): 60 fps. For Windows and macOS only.
bitrate

The encoding bitrate (Kbps) of the video. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution and frame rate, see Video profile.

  • STANDARD_BITRATE(0): (Recommended) Standard bitrate mode.
  • COMPATIBLE_BITRATE(-1): Adaptive bitrate mode. In general, Agora suggests that you do not use this value.
minBitrate

The minimum encoding bitrate (Kbps) of the video.

The 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 sacrifice the smoothness of the video transmission. Unless you have special requirements for image quality, Agora does not recommend changing this value.

Attention: This parameter only applies to the interactive streaming profile.
orientationMode
The orientation mode of the encoded video. See EORIENTATION_MODE.
degradationPreference
Video degradation preference under limited bandwidth. See EDEGRADATION_PREFERENCE.
Attention: When this parameter is set to MAINTAIN_FRAMERATE (1) or MAINTAIN_BALANCED (2), orientationMode needs to be set to ORIENTATION_MODE_ADAPTIVE (0) at the same time, otherwise the setting will not take effect.
mirrorMode

Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See EVIDEO_MIRROR_MODE_TYPE.

Attention: This parameter does not take effect. To achieve a mirror display effect, configure the mirror settings in Unreal Engine.
Attention: By default, the video is not mirrored.
advanceOptions
Advanced options for video encoding. See FAdvanceOptions.