Video Profile Settings

This section introduces how to set video publishing parameters using the audio/video SDK.

1. Introduction

When setting video profiles in a video call or an interactive live stream, you can adjust video picture resolution, frame rate, and bit rate according to preference for better user experience.

2. Implementation

Before configuring video profiles, make sure that the basic real-time audio/video function is ready for your project. See details in Quickstart Guide.

Thunder SDK uses setVideoEncoderConfig to set video-related publishing brackets.

    /**
     * Get video start parameters from Argo according to the parameters;
     * If it has been previewed, it will take effect in the preview;
     * If the publishing has already started, update the parameters, and the local preview and remote subscription will see the changed effect;
     * Need to be called after "initialization"
     * @param yyVideoConfig Specific encoding configuration
     * @return 0: Succeed. For other errors, refer to {@link ThunderRtcConstant.ThunderRet}
     */
    public int setVideoEncoderConfig(ThunderVideoEncoderConfiguration yyVideoConfig)

ThunderVideoEncoderConfiguration defines two types, including playType (playing type) and publishMode (publishing bracket).

Playing type:

For publishing modes, there are several types, as defined below:

    public static final class ThunderPublishPlayType {
        public static final int THUNDERPUBLISH_PLAY_SINGLE = 0;  // Single publishing
        public static final int THUNDERPUBLISH_PLAY_INTERACT = 1;  // Co-hosting video publishing
        public static final int THUNDERPUBLISH_PLAY_SCREENCAP = 2;  // Screen recording publishing
        public static final int THUNDERPUBLISH_PLAY_MULTI_INTERACT  = 3;  // Multi-person co-hosting video publishing
    }

Depending on which of these publishing types you are working with, video optimization will target different aspects.

Publishing bracket:

The current client is divided into the following brackets:

    /**
     * Publishing bracket
     */
    public static final class ThunderPublishVideoMode {
        public static final int THUNDERPUBLISH_VIDEO_MODE_NORMAL = 1;          /*! Normal */
        public static final int THUNDERPUBLISH_VIDEO_MODE_HIGHQULITY = 2;      /*! High quality */
        public static final int THUNDERPUBLISH_VIDEO_MODE_SUPERQULITY = 3;     /*! Super quality */
        public static final int THUNDERPUBLISH_VIDEO_MODE_BLUERAY_2M = 4;      /*! Blue ray 2M */
        public static final int THUNDERPUBLISH_VIDEO_MODE_BLUERAY_4M = 5;      /*! Blue ray 4M */
    }

To flexibly customize user-defined video quality, Thunder uses a dynamically reconfigurable scheme in the background to determine video publishing clarity and smoothness. Users can customize each bracket’s resolution, bit rate, frame rate, and other parameters, and may contact technical support to modify associated parameters.

Call Timing

Once ThunderEngine is initialized, you can call setVideoEncoderConfig as needed to set video profiles and to set a required publishing bracket in this method.

Sample Codes

//Create encoding configuration
ThunderVideoEncoderConfiguration configuration = new ThunderVideoEncoderConfiguration();
configuration.playType = ThunderRtcConstant.ThunderPublishPlayType.THUNDERPUBLISH_PLAY_SINGLE;
configuration.publishMode = ThunderRtcConstant.ThunderPublishVideoMode.THUNDERPUBLISH_VIDEO_MODE_HIGHQULITY;
//Settings
ThunderEngine.setVideoEncoderConfig(configuration);

3. API Reference

4. Notices

  • Live streaming scenarios commonly require a higher bit rate to maintain image clarity, so it is recommended that an anchor uses a relatively stable network.
  • The setting of each parameter in this document may affect billing. See details in Billing.

5. Common Brackets

Generally, you should fit video parameters to the situation or scenario. For example, in a one-to-one teaching scenario, the windows of the teacher and the student are both large, requiring a high resolution; therefore, the frame and bit rates are also higher. However, in a one-to-four scenario, the windows of the teacher and the students are relatively small, allowing for a low resolution, lower bit and frame rates, overall reducing the resources consumed by encoding and decoding and relieving stress on downlink bandwidth. Commonly, the modes can be set based on the values recommended in the following scenarios.

  • Two-user video call:
    • Resolution 320 x 240; frame rate 15 fps; bit rate 200 kbps
    • Resolution 640 x 360; frame rate 15 fps; bit rate 400 kbps
  • Multi-user video call:
    • Resolution 160 x 120; frame rate 15 fps; bit rate 65 kbps
    • Resolution 320 x 180; frame rate 15 fps; bit rate 140 kbps
    • Resolution 320 x 240; frame rate 15 fps; bit rate 200 kbps

Refer to the following table when considering the customization of video parameters.

Resolution (Width x Height)Frame Rate (fps)Standard Bit Rate (kbps, Applicable to Communication)Live Streaming Bit Rate (kbps, Applicable to Live Streaming)
160 x 1201565130
120 x 1201550100
320 x 18015140280
180 x 18015100200
240 x 18015120240
320 x 24015200400
240 x 24015140280
424 x 24015220440
640 x 36015400800
360 x 36015260520
640 x 360306001200
360 x 36030400800
480 x 36015320640
480 x 36030490980
640 x 480155001000
480 x 48015400800
640 x 480307501500
480 x 480306001200
848 x 480156101220
848 x 480309301860
640 x 48010400800
1280 x 7201511302260
1280 x 7203017103420
960 x 720159101820
960 x 7203013802760

Was this page helpful?

Helpful Not helpful
Submitted! Your feedback would help us improve the website.
Feedback
Top