6.2 Video encoding parameters
Encoding parameters determine the quality of video watched by remote users and recorded in the cloud.
public struct TRTCVideoEncParam
public bool enableAdjustRes
Description: the minimum value the SDK is allowed to reduce the bitrate to under poor network conditions
- 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.
- 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.
public UInt32 minVideoBitrate
public TRTCVideoResolutionMode resMode
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.
public UInt32 videoBitrate
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.
public UInt32 videoFps
Description: video resolution
- 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.
public TRTCVideoResolution videoResolution