Struct TRTCVideoEncParam
6.2 Video encoding parameters
Encoding parameters determine the quality of video watched by remote users and recorded in the cloud.
Inherited Members
Namespace: trtc
Assembly: cs.temp.dll.dll
Syntax
public struct TRTCVideoEncParam
Fields
enableAdjustRes
Declaration
public bool enableAdjustRes
Field Value
Type | Description |
---|---|
System.Boolean |
minVideoBitrate
Description: the minimum value the SDK is allowed to reduce the bitrate to under poor network conditions
**Value:**
- If you are tolerant of stutter but have high requirements on clarity, you can set `minVideoBitrate` to 60% of `videoBitrate`.
- If you prioritize smoothness over clarity, you can set `minVideoBitrate` to 200 Kbps.
- Setting `videoBitrate` and `minVideoBitrate` to the same value will disable the SDK’s automatic bitrate control feature.
- If this parameter is `0` (default value), the SDK will determine the lowest bitrate according to the resolution.
**Note:**
- To avoid blurry or pixelated video, you are not advised to set `minVideoBitrate` too low if the target resolution is high.
For example, if the resolution is set to 720p and the bitrate to 200 Kbps, the encoded video will be heavily pixelated.
Declaration
public UInt32 minVideoBitrate
Field Value
Type | Description |
---|---|
UInt32 |
resMode
Declaration
public TRTCVideoResolutionMode resMode
Field Value
Type | Description |
---|---|
TRTCVideoResolutionMode |
videoBitrate
Description: target video bitrate. The SDK encodes streams at the target video bitrate, but will reduce the bitrate under poor network conditions.
**Value:** Please refer to the recommended bitrates for different `TRTCVideoResolution` values. You may increase the value moderately.
For example, the recommended bitrate for `TRTCVideoResolution_1280_720` is 1200 Kbps, but you can set the target bitrate to 1500 Kbps for higher video quality.
**Note:** Normally, the SDK encodes streams at the bitrate specified by `videoBitrate`, but under poor network conditions, it will reduce the bitrate, whose minimum allowed value is determined by `minVideoBitrate`.
If you are tolerant of stutter but have high requirements on clarity, you can set `minVideoBitrate` to 60% of `videoBitrate`.
If you prioritize smoothness over clarity, you can set `minVideoBitrate` to 200 Kbps.
Setting `videoBitrate` and `minVideoBitrate` to the same value will disable the SDK’s automatic bitrate control feature.
Declaration
public UInt32 videoBitrate
Field Value
Type | Description |
---|---|
UInt32 |
videoFps
Description: video capturing frame rate
**Value:** 15 or 20 fps. Video will stutter severely if the frame rate is lower than 5 fps and slightly if it is lower than 10 fps. Setting the frame rate to higher than 20 fps would be a waste of resources (the frame rate of films is 24 fps).
**Note:** On many Android phones, the front camera does not support a capturing frame rate of higher than 15 fps. For some that emphasize beauty filters, the frame rate may be lower than 10 fps.
Declaration
public UInt32 videoFps
Field Value
Type | Description |
---|---|
UInt32 |
videoResolution
Description: video resolution
**Value:**
- For video calls, we recommend a resolution of 360 × 640 or lower and `Portrait` for `resMode`.
- For mobile live streaming, we recommend a resolution of 540 × 960 and `Portrait` for `resMode`.
- On Windows and macOS, we recommend a resolution of 640 × 360 or above and `Landscape` for `resMode`.
**Note:** `TRTCVideoResolution` supports only landscape resolutions by default, such as 640 × 360.
To use portrait resolutions, set `resMode` to `Portrait`. For example, if `videoResolution` is `640 × 360` and `resMode` is set to `Portrait`, the resolution 360 × 640 will be used.
Declaration
public TRTCVideoResolution videoResolution
Field Value
Type | Description |
---|---|
TRTCVideoResolution |