TRTCVideoEncParam class

Video encoding parameters

These settings determine the quality of image viewed by remote users as well as the image quality of recorded video files in the cloud.

Constructors

TRTCVideoEncParam({int videoBitrate = 1600, TRTCVideoResolution videoResolution = TRTCVideoResolution.res_1280_720, TRTCVideoResolutionMode videoResolutionMode = TRTCVideoResolutionMode.portrait, int videoFps = 10, int minVideoBitrate = 0, bool enableAdjustRes = false})

Properties

enableAdjustRes bool
  • Field description: whether resolution adjustment is allowed
  • Recommended value
    • For mobile live streaming, false is recommended.
    • For video call, if smoothness is of higher priority, true is recommended. In this case, if the network bandwidth is limited, the SDK will automatically reduce the resolution to ensure better smoothness (only valid for TRTCVideoStreamTypeBig).
    • Default value: false.
  • Note: when recording is needed, if true is selected, please make sure that the resolution adjustment will not affect the recording effect during the call.
  • getter/setter pair
    hashCode int
    The hash code for this object.
    no setterinherited
    minVideoBitrate int
  • Field description: minimum video bitrate. The SDK will reduce the bitrate to as low as the value specified by minVideoBitrate only if the network conditions are poor.
  • Recommended value
    • If you want to "ensure definition while allowing lag", you can set minVideoBitrate to 60% of videoBitrate.
    • If you want to "ensure smoothness while allowing blur", you can set minVideoBitrate to 200 Kbps.
    • If you set videoBitrate and minVideoBitrate to the same value, it is equivalent to disabling the adaptive adjustment capability of the SDK.
    • Default value: 0, indicating that the lowest bitrate will be automatically set by the SDK according to the resolution.
  • Note
    • If you set the resolution to a high value, it is not suitable to set minVideoBitrate too low; otherwise, the video image will become blurry and heavily pixelated.
    • For example, if the resolution is set to 720p and the bitrate is set to 200 Kbps, then the encoded video image will be heavily pixelated.
  • getter/setter pair
    runtimeType Type
    A representation of the runtime type of the object.
    no setterinherited
    videoBitrate int
  • Field description: target video bitrate. The SDK encodes streams at the target video bitrate and will actively reduce the bitrate only if the network conditions are poor.
  • Recommended value: please see the optimal bitrate for each specification in TRTCVideoResolution. You can also slightly increase the optimal bitrate. For example, TRTCVideoResolution.res_1280_720 corresponds to the target bitrate of 1,200 Kbps. You can also set the bitrate to 1,500 Kbps for higher definition.
  • Note: the SDK does its best to encode streams at the bitrate specified by videoBitrate and will actively reduce the bitrate to as low as the value specified by minVideoBitrate only if the network conditions are poor.
    • If you want to "ensure definition while allowing lag", you can set minVideoBitrate to 60% of videoBitrate.
    • If you want to "ensure smoothness while allowing blur", you can set minVideoBitrate to 200 Kbps.
    • If you set videoBitrate and minVideoBitrate to the same value, it is equivalent to disabling the adaptive adjustment capability of the SDK.
  • getter/setter pair
    videoFps int
  • Field description: video capturing frame rate
  • Recommended value: 15 or 20 fps. If the frame rate is lower than 5 fps, there will be obvious lagging; if lower than 10 fps but higher than 5 fps, there will be slight lagging; if higher than 20 fps, too many resources will be wasted (the frame rate of movies is generally 24 fps).
  • Note: the front cameras on many Android phones do not support a capturing frame rate higher than 15 fps. For some Android phones that focus too much on beautification features, the capturing frame rate of the front cameras may be lower than 10 fps.
  • getter/setter pair
    videoResolution TRTCVideoResolution
  • Field description: video resolution
  • Recommended value
    • For video call, we recommend you select a resolution of 360x640 or below and select Portrait for resMode.
    • For mobile live streaming, we recommend you select a resolution of 540x960 and select Portrait for resMode.
    • For Windows and macOS, we recommend you select a resolution of 640x360 or above and select Landscape for resMode.
  • Note
    • TRTCVideoResolution supports only the landscape resolution by default, such as 640x360.
    • To use a portrait resolution, please specify resMode as Portrait; for example, when used together with Portrait, 640x360 will become 360x640.
  • Default value: TRTCVideoResolution.res_480_360
  • getter/setter pair
    videoResolutionMode TRTCVideoResolutionMode
  • Field description: resolution mode (landscape/portrait)
  • Recommended value: for mobile live streaming, Portrait is recommended; for Windows and macOS, Landscape is recommended.
  • Note: if 640x360 resolution is selected for videoResolution and Portrait is selected for resMode, then the final output resolution after encoding will be 360x640.
  • Default value: TRTCVideoResolutionMode.portrait
  • getter/setter pair

    Methods

    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    toString() String
    A string representation of this object.
    inherited

    Operators

    operator ==(Object other) bool
    The equality operator.
    inherited