please select
RTC Engine
  • Overview
  • Web
    • Run Sample Demo
    • Integration
    • Basic Features
      • Screen Sharing
      • Live Streaming
      • Media Device
      • Audio Volume
      • Set Encoding Profile
      • Detect Network Quality
      • Detect Capabilities
    • Advance Features
      • Enable AI Denoiser
      • Enable Audio Mixer
      • Enable Watermark
      • Enable Virtual Background
      • Enable Beauty and Effects
      • Data Messages
      • Custom Capturing and Rendering
    • API List
    • Released Notes
    • Supported Platforms
    • Web FAQs
      • Optimize Multi-Person Video Calls
      • Handle Autoplay Restriction
      • Handle Firewall Restriction
      • Others
  • Android
    • Run Sample Code
    • Integration
    • Basic Features
      • Sensing Network Quality
      • Enabling Screen Sharing
      • Setting Video Quality
      • Rotating Videos
    • Advanced Features
      • Testing Newwork Quality
      • Custom Capturing and Rendering
      • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCStatistics
      • TRTCCloudListener
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • Error Codes
    • Solution
      • Real-Time Chorus (TUIKaraoke)
        • Quick Integration
        • Implementation Steps
        • Song Synchronization
        • Lyric Synchronization
        • Vocal Synchronization
        • Mixing Stream Solution
        • TRTCKaraoke APIs
        • FAQs
    • Release Notes
  • iOS
    • Run Sample Code
    • Integration
    • Basic Features
      • Sensing Network Quality
      • Enabling Screen Sharing
      • Setting Video Quality
      • Rotating Videos
    • Advanced Features
      • Testing Network Quality
      • Custom Capturing and Rendering
      • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • ErrorCode
    • Solution
      • Quick Integration
      • Implementation Steps
      • Song Synchronization
      • Lyric Synchronization
      • Vocal Synchronization
      • Mixing Stream Solution
      • TRTCKaraoke APIs
      • FAQs
    • Release Notes
  • macOS
    • Run Sample Code
    • Integration
    • Basic Features
      • Sensing Network Quality
      • Enabling Screen Sharing
      • Sharing Computer Audio
      • Setting Video Quality
      • Rotating Videos
    • Advanced Features
      • Testing Hardware Devices
      • Testing Network Quality
      • Custom Capturing and Rendering
      • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • ErrorCode
      • Release Notes
    • Release Notes
  • Windows
    • Run Sample Code
    • Integration
    • Basic Features
      • Sensing Network Quality
      • Enabling Screen Sharing
      • Setting Video Quality
      • Rotating Videos
    • Advanced Features
      • Testing Hardware Devices
      • Testing Network Quality
      • Custom Capturing and Rendering
      • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • ITRTCCloud
      • ITRTCStatistics
      • TRTCCloudCallback
      • ITXAudioEffectManager
      • ITXDeviceManager
      • Type Definition
      • Deprecated Interface
      • Error Codes
    • Release Notes
  • Electron
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Client APIs
      • Overview
      • Error Codes
  • Flutter
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Client APIs
      • Overview
      • Error Codes
  • Unity
    • Integration
      • 1.API Examples
      • 2Importing the SDK
    • Client APIs
      • Overview
      • Error Codes
  • Qt
    • Integration
      • 1.Importing the SDK
  • Overview
    • Overview
  • Concepts
  • Features
  • Performance Statistics
  • Pricing
    • Free Minutes
    • RTC-Engine Monthly Packages
    • Billing Explanation for Subscription Package Duration
    • Pay-as-you-go
      • Billing of Audio and Video Duration
      • Billing of On-Cloud Recording and Recording Delivery
      • Billing of MixTranscoding and Relay to CDN
  • FAQs
    • FAQs for Beginners
    • Migration Guide
      • Twilio Video to Tencent RTC
      • Billing
      • Features
      • UserSig
      • Firewall Restrictions
      • How to Downsize Installation Package
      • TRTCCalling for Web
      • Audio and Video Quality
      • Others
RTC Engine

Set Encoding Profile

This tutorial mainly introduces how to
1. Set video encoding profile.
2. Set audio encoding profile.
3. Set screen sharing encoding profile.

Demo



Set Video Encoding Profile

You can set the video encoding profile through the parameter profile in trtc.startLocalVideo() and trtc.updateLocalVideo().

Specify a predefined profile, and each profile corresponds to a set of recommended resolution, frame rate, and bit rate.
// Specify video profile when starting
await trtc.startLocalVideo({
option: { profile: '480p' }
});
// Dynamically adjust video profile during the call
await trtc.updateLocalVideo({
option: { profile: '360p' }
});
Video Property Profile List
Video Profile
Resolution (width x height)
Frame Rate (fps)
Bit Rate (kbps)
Note
120p
160 x 120
15
200

120p_2
160 x 120
15
100
Only supported in v5.1.1+
180p
320 x 180
15
350

180p_2
320 x 180
15
150
Only supported in v5.1.1+
240p
320 x 240
15
400

240p_2
320 x 240
15
200
Only supported in v5.1.1+
360p
640 x 360
15
800

360p_2
640 x 360
15
400
Only supported in v5.1.1+
480p
640 x 480
15
900

480p_2 (Default)
640 x 480
15
500
Only supported in v5.1.1+
720p
1280 x 720
15
1500

1080p
1920 x 1080
15
2000

1440p
2560 x 1440
30
4860

4K
3840 x 2160
30
9000

Specify custom resolution, frame rate, and bit rate:
// Specify video profile when starting
await trtc.startLocalVideo({
option: { profile: { width: 640, height: 480, frameRate: 15, bitrate: 900 /* kpbs */} }
});
// Dynamically adjust video profile during the call
await trtc.updateLocalVideo({
option: { profile: { width: 640, height: 360, frameRate: 15, bitrate: 800 /* kpbs */} }
});
Note:
1. Due to device and browser limitations, the video resolution may not match exactly. In this case, the browser will automatically adjust the resolution to make it closer to the one specified by the profile.
2. Due to the network and cpu performance, the resolution and frame rate of video encoding may be lower than expected.
2.1 For camera, it's smooth first as default, which reduce the resolution appropriately and give priority to the encoding of frame rate when the performance is insufficient.
2.2 For screen sharing, it's clear first as default, which reduce the frame rate appropriately and give priority to the encoding of resolution when the performance is insufficient.
You can change this priority by the qosPreference paramerter in trtc.startLocalVideo() and trtc.updateLocalVideo(). Refer to QOS_PREFERENCE_SMOOTH and QOS_PREFERENCE_CLEAR.

Set Audio Encoding Profile

You can set the audio encoding profile through the parameter profile in trtc.startLocalAudio().
// Default profile
await trtc.startLocalAudio({ option: { profile: TRTC.TYPE.AUDIO_PROFILE_STANDARD }});

// Note: SDK does not support dynamic adjustment of audio profile during the call.
// You have to set audio profile in trtc.startLocalAudio
await trtc.updateLocalAudio({ option: { profile: TRTC.TYPE.AUDIO_PROFILE_HIGH }}); // Does not work.
Audio Profile
Sampling Rate
Channel
Bitrate (kbps)
TRTC.TYPE.AUDIO_PROFILE_STANDARD (Default)
48000
Mono
40
TRTC.TYPE.AUDIO_PROFILE_HIGH
48000
Mono
128
TRTC.TYPE.AUDIO_PROFILE_STANDARD_STEREO
48000
Stereo
64
TRTC.TYPE.AUDIO_PROFILE_HIGH_STEREO
48000
Stereo
192

Set Screen Sharing Encoding Profile

You can set the screen sharing encoding profile through the parameter profile in trtc.startScreenShare().
// The default profile is '1080p'
await trtc.startScreenShare({ option: { profile: '1080p_2' }});
// Note: SDK does not support dynamic adjustment of screen sharing profile during the call.

// Specify custom profile when starting
await trtc.startLocalVideo({
option: { profile: { width: 1280, height: 720, frameRate: 15, bitrate: 1500 /* kpbs */} }
});
Screen Sharing Property Profile List
Screen Profile
Resolution (width x height)
Frame Rate (fps)
Bitrate (kbps)
480p
640 x 480
5
900
480p_2
640 x 480
30
1000
720p
1280 x 720
5
1200
720p_2
1280 x 720
30
3000
1080p
1920 x 1080
5
1600
1080p_2
1920 x 1080
30
4000