enableSmallVideoStream abstract method

int enableSmallVideoStream(
  1. bool enable,
  2. TRTCVideoEncParam smallVideoEncParam
)

Enable dual-channel encoding mode with big and small images

In this mode, the current user's encoder will output two channels of video streams, i.e., HD big image and Smooth small image, at the same time (only one channel of audio stream will be output though).

In this way, other users in the room can choose to subscribe to the HD big image or Smooth small image according to their own network conditions or screen size.

Parameters:

  • enable(bool):
    • Whether to enable small image encoding. Default value: false
  • smallVideoEncParam(TRTCVideoEncParam):
    • Video parameters of small image stream.

Note: Dual-channel encoding will consume more CPU resources and network bandwidth; therefore, this feature can be enabled on macOS, Windows, or high-spec tablets, but is not recommended for phones.

Return Description:

  • 0: success;
  • -1: the current big image has been set to a lower quality, and it is not necessary to enable dual-channel encoding.

Implementation

int enableSmallVideoStream(bool enable, TRTCVideoEncParam smallVideoEncParam);