Join Tencent RTC at NAB Show 2024 in Las Vegas!
Learn more 
Only  $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Only $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Grab It Now 
Join Tencent RTC at NAB Show 2024 in Las Vegas!
Learn more 
Only  $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Only $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Grab It Now 
RTC Engine
Overview
  • Web
    • Demo Quick Run
    • SDK Quick Start
    • 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
      • SEI Message
      • Custom Capturing and Rendering
      • Web Beautification Effects
    • Best Practices
      • Optimize Multi-Person Video Calls
      • Handle Autoplay Restriction
      • Handle Firewall Restriction
    • API List
    • Released Notes
    • Supported Platforms
    • Web FAQs
  • Android
    • 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.Setting Video Quality
      • 10.Rotating Videos
    • 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
    • Release Notes
  • iOS
    • 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.Setting Video Quality
      • 10.Rotating Videos
    • 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
  • macOS
    • 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
    • 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 C++
    • 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.Setting Video Quality
      • 10.Rotating Videos
    • 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
  • Pricing
    • RTC-Engine Packages
    • Billing of On-Cloud Recording
    • Billing of MixTranscoding and Relay to CDN
    • Billing Explanation for Subscription Package Duration
    • Billing of Monitoring Dashboard
    • Free Minutes
    • Pay-As-You-Go
  • Concepts
  • Features
  • Performance Statistics
  • 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.

Set Video Encoding Profile

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

Specify a predefined profile, 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)
120p
160 x 120
15
200
180p
320 x 180
15
350
240p
320 x 240
15
400
360p
640 x 360
15
800
480p
640 x 480
15
900
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 */} }
});
Due to device and browser limitations, the video resolution may not match exactly. In this case, the browser will automatically adjust the resolution to be close to the resolution corresponding to the Profile.
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 be close to the resolution corresponding to 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 of 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 of 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 works.
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 of 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