The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.

TRTC SDK Related

Last updated: 2026-04-02 10:10:29

What Is the RoomID of Tencent Real - Time Communication SDK (TRTC SDK)? What Is the Value Range?

RoomID is the room number, used to uniquely identify a room. The value range of the room number is from 1 to 4294967295, which is maintained and assigned by developers themselves.

What Is the UserID For Entering a Room in the Real-Time Audio and Video SDK (TRTC SDK)? What Is the Value Range?

UserID, which is the user ID, is used to uniquely identify a user in a real-time audio and video application. It is recommended that the length of the value range should not exceed 32 bytes. Please use English letters, digits or underscores, case sensitive.

What Is the Lifecycle of a Real-Time Audio and Video SDK (TRTC SDK) Room?

The first user to join the room is the current room owner, but this user cannot actively dissolve the room.
In call mode: The backend immediately dissolves the room when all users actively exit the room.
In live streaming mode: When the last user to exit the room has the role of a streamer, the backend immediately dissolves the room; when the last user to exit the room has the role of an audience, the backend waits for 10 minutes before dissolving the room.
If a single user in the room has an unexpected disconnection, the server will remove the user from the current room after 90 seconds. If all users in the room have an unexpected disconnection, the server will automatically dissolve the current room after 90 seconds. The waiting time for a user's unexpected disconnection will be included in the billing duration statistics.
When the room that a user wants to join does not exist, the backend will automatically create a room.

Does TRTC SDK Support Not Subscribing to Audio and Video Stream?

To achieve the "instant loading" effect, by default, streams are automatically subscribed when entering the room. You can switch to manual subscription mode through the setDefaultStreamRecvMode API.

Does TRTC SDK Support Customizing the Stream ID For Bypass Stream Pushing?

Supported. You can specify streamId through the TRTCParams parameter of enterRoom, or call the startPublishing API and pass the streamId parameter.

What Roles Does TRTC (Tencent Real - Time Communication) SDK Support For Live Streams? What Are the Differences?

In live-streaming scenarios (TRTCAppSceneLIVE and TRTCAppSceneVoiceChatRoom), there are two roles: TRTCRoleAnchor (streamer) and TRTCRoleAudience (audience). The difference is that the streamer role can upload and download audio and video data at the same time, while the audience role only supports downloading and playing other people's data. You can switch roles by calling switchRole().

What Is the Role of the Real - Time Communication SDK (TRTC SDK)?

In the live stream scenario, you can set the roles of streamer and audience. The streamer role TRTCRoleAnchor has permissions for uplink and downlink audio and video, supporting up to 50 concurrent users. The audience role TRTCRoleAudience only has permissions for downlink audio and video, supporting up to 100,000 concurrent users.

TRTC SDK Room Supports Which Use Cases?

Supported in the following scenarios:
TRTCAppSceneVideoCall: Video call scenario, suitable for one-to-one video calls, 300-person video conferencing, online consultations, video chats, remote interviews, etc.
TRTCAppSceneLIVE: Video interactive live streaming, suitable for low-latency video live streaming, interactive classrooms with one hundred thousand participants, video live PK, video blind date rooms, interactive classrooms, remote training, and ultra-large conferences.
TRTCAppSceneAudioCall: Voice call scenario, suitable for 1 - on - 1 voice calls, 300 - person voice conferences, voice chats, audio conferencing, online Werewolf, etc.
TRTCAppSceneVoiceChatRoom: Interactive live audio streaming, suitable for low-latency audio streaming, live audio co-anchoring, voice chat rooms, karaoke rooms, FM radio stations.

What Platforms Does the Real - Time Audio and Video SDK (TRTC SDK) Support?

Supported platforms include iOS, Android, Windows (C++), Windows (C#), Mac, Web, Electron, and WeChat mini program. For more details, see Platform Support.

How Many Rooms Can Be Created Simultaneously At Most in the Real-Time Interactive Audio and Video SDK (TRTC SDK)?

Supports up to 4294967294 rooms existing concurrently, with no limit on the total quantity of rooms.

How to Create a Room?

Rooms are automatically created by the Tencent Cloud backend when clients enter a room. You do not need to manually create a room; simply call the relevant client API "Enter Room":

What Is the Maximum Bandwidth Supported By the Video Server of the Real-Time Interactive Video SDK (TRTC SDK)?

There are no restrictions.

Does TRTC SDK Support Private Deployment?

Real-time audio and video private deployment is not fully open. If you need to consult or use a private service, please fill out Private Service Questionnaire. We will complete the assessment and provide feedback within 2 to 3 business days.

Does the Domain Name Need to Be Registered For Use When Enabling Relayed Live Streaming For TRTC (Tencent Real-Time Communication) SDK?

To enable relayed live streaming, according to the requirements of relevant national departments, the playback domain needs to be registered before use. For more details, see CDN live streaming viewing.

What Is the Approximate Delay of the Real - Time Audio and Video SDK (TRTC SDK)?

Globally, end-to-end average latency is less than 300 ms.

Does TRTC SDK Support the Active Calling Feature?

It needs to be resolved in combination with the signaling channel. For example, to make a call using the custom message of IM service, you can refer to the scenario-based Demo example in the SDK source code.

Does TRTC (Tencent Real-Time Communication) SDK Support Bluetooth Headphones in One-To-One Video Calls?

It is supported.

Does TRTC (Tencent Real - Time Communication) SDK Support Use Overseas?

It is supported.

Does the Real-Time Audio and Video SDK (TRTC SDK) Support Screen Sharing When Accessing the PC?

It is supported. You can refer to the following documents:
For details about the screen sharing API, see Windows (C++) API or Windows (C#) API. Additionally, you can use Electron API.

Does TRTC SDK Support Use in WeChat Official Accounts?

Due to wechat official account limitations, it is recommended to use mini program SDK in WeChat for a better experience.

Can Local Video Files Be Shared to the Real-Time Communication SDK (TRTC SDK)?

Supported, it can be achieved through the custom collection feature.

Can TRTC (Tencent Real - Time Communication) SDK Record Live Video and Store It On the Phone Locally?

Not supported to store directly on phone locally. After recording, video files are stored on the Video on Demand platform by default. You can download and save them to your phone. For more details, see On-Cloud Recording and Playback.

Does TRTC SDK Support Pure Real-Time Audio?

Support audio-only.

Can Multiple Screen Sharing Be Performed in One Room At the Same Time?

Currently, a room can only have one secondary stream of screen sharing.

Specified Window Sharing (SourceTypeWindow) - Will the Resolution of the Video Stream Change When the Window Size Changes?

By default, the SDK will automatically adjust the encoding parameters according to the size of the shared window. To fix the resolution, you need to call the setSubStreamEncoderParam API to set the encoding parameters for screen sharing, or specify the corresponding encoding parameters when calling startScreenCapture.

Does the Tencent Real-Time Communication SDK (TRTC SDK) Support 1080P?

Supported. You can set the resolution through the video encoding parameter setVideoEncoderParam of the SDK.

Can TRTC SDK Customize Acquisition Data?

Supported on some platforms. For detailed information, see custom capture and rendering.

Can TRTC SDK Communicate With MLVB SDK?

No.

Can TRTC SDK Communicate With MLVB SDK?

The solution architecture of audio and video call TRTC and MLVB SDK backend is different, so direct communication is not supported. It can only bypass stream pushing from the TRTC backend to CDN.

What Are the Differences in the AppScene of the Room - Entry Mode of the Real - Time Interactive Audio and Video SDK (TRTC SDK)?

The TRTC SDK supports four different room entry modes. Among them, VideoCall and VoiceCall are collectively referred to as call modes, and Live and VoiceChatRoom are collectively referred to as live streaming modes.
In calling mode, TRTC supports up to 300 people online in a single room simultaneously and up to 50 people speaking at the same time. It is suitable for application scenarios such as 1 - to - 1 video calls, 300 - person video conferences, online consultations, remote interviews, video customer services, online Werewolf games.
Under the live streaming mode, TRTC supports up to 100,000 people being online simultaneously in a single room, with a mic on/off switching latency of less than 300 ms and a viewing latency of less than 1,000 ms, as well as smooth mic on/off switching technology. It is suitable for application scenarios such as low-latency interactive live streaming, 100,000-person interactive classrooms, video dating, online education, remote training, ultra-large conferences, etc.

Does the Tencent Real-Time Communication SDK (TRTC SDK) Support Hands-Free Mode For Audio and Video Calls?

Supported. The hands-free mode is achieved by setting the audio routing. The Native SDK switches through the setAudioRoute API, and the mini program sets it through the sound-mode attribute of the <live-player> tag.

Does TRTC SDK Support Volume Level Prompts?

Supported. Enabled through the enableAudioVolumeEvaluation API.

Does TRTC SDK Support Setting a Mirrored Image?

Supported. Set the mirror mode of the local camera preview screen through the setLocalViewMirror API, or set the mirror mode of the encoder output screen through the setVideoEncoderMirror API.

Does TRTC (Tencent Real - Time Communication) SDK Support Recording Audio During a Call to a Local File?

Supported. All audio (including local audio, remote audio, BGM, etc.) during a call can be recorded into a file through the startAudioRecording API. Currently supported audio formats include PCM, WAV, and AAC.

Does TRTC SDK Support Video Recording Into Files During Audio and Video Interoperability?

Supports self-owned server recording (i.e. audio or video recording). If you need to use it, please submit a ticket to contact us for the SDK and relevant instructions. You can also use On-Cloud Recording and Playback to record videos.

Does TRTC (Tencent Real-Time Communication) SDK Support Functions Similar to WeChat Video Call, Such As Floating Window and Switch Between Big and Small Windows?

This type of feature belongs to UI layout logic, and the SDK does not restrict UI display processing. In the official Demo, example codes for picture front-back stacking and nine-grid layout modes are provided, and support for floating window, switch between big and small windows, and picture dragging. For more details, see Official Demo.

How Does TRTC SDK Implement Pure Audio Call?

The TRTC SDK does not distinguish between audio and video channels. When only startLocalAudio is called without calling startLocalPreview, it is a pure audio call mode.

How Does TRTC SDK Implement Bypass Stream Pushing and Recording in Pure Audio Call?

6.9 previous versions: When entering the room, it is necessary to construct json{\"Str_uc_params\":{\"pure_audio_push_mod\":1}} and pass it into TRTCParams.businessInfo. 1 indicates bypass stream pushing, and 2 indicates bypass stream pushing + recording.
TRTC SDK 6.9 and later versions: When entering the room, select the scene parameter as TRTCAppSceneAudioCall or TRTCAppSceneVoiceChatRoom.

Does the TRTC (Tencent Real-Time Communication) SDK Room Support Removing Users, Prohibiting Speech, and Muting?

It is supported.
For simple signaling operations, you can use TRTC's custom signaling interface sendCustomCmdMsg. Developers can define their own control signaling. The call recipient who receives the control signaling can perform the corresponding operation. For example, to remove a user, define a signal for removing a user. The user who receives this signal can exit the room on their own.
If more comprehensive operation logic is required, it is recommended that developers use Chat to implement the relevant logic, map the TRTC room to the IM Group, and send and receive custom messages in the IM Group to achieve the corresponding operations.

Does the Tencent Real-Time Communication SDK (TRTC SDK) Support Live Playback of RTMP/FLV Streams?

Supported. Currently, TXLivePlayer is packaged in TRTC SDK. If more player features are required, LiteAVSDK_Professional version can be directly used, which includes all features.

How Many People Can the Real - Time Audio and Video SDK (TRTC SDK) Support in a Call At Most?

In call mode, a single room supports up to 300 people online simultaneously, and up to 50 people can turn on their cameras or microphones simultaneously.
In live streaming mode, a single room supports up to 100,000 people watching online as the audience, and up to 50 people starting their cameras or microphones as streamers.

How Does the Tencent Real-Time Communication SDK (TRTC SDK) Implement Live - Streaming Scenario Applications?

TRTC has launched a low-latency interactive live streaming solution for online live streaming scenarios that can ensure the minimum delay between the anchor and the mic-connecting anchor to 200 ms, with the delay for general audiences within 1 s, and its strong resistance to weak networks adapts to the complex mobile terminal network environment. For specific operation instructions, see Run Live Streaming Mode.

Can the Custom Message Sending API of the Real - Time Audio and Video SDK (TRTC SDK) Be Used to Implement Functions Such As Chat Rooms and Bullet Screens?

No. Sending custom messages via TRTC SDK is suitable for simple and low-frequency signaling transmission scenarios. For specific limitations, please refer to Usage Limits.

Does the Playback of Background Audio in the Real-Time Audio and Video SDK (TRTC SDK) Support Loop Playback? Does It Support Adjusting the Playback Progress of the Background Audio?

Supported. Loop playback can be achieved by re-calling the playback API within the completion callback. Playback progress can be set via TXAudioEffectManager.seekMusicToPosInMS.
Note:
setBGMPosition() is deprecated in v7.3. Use TXAudioEffectManager.seekMusicToPosInMS instead.

Does TRTC SDK Have a Listening Callback For Room Members Entering or Leaving the Room? Can onUserEnter/onUserExit Be Used?

Yes. TRTC uses onRemoteUserEnterRoom/onRemoteUserLeaveRoom to monitor room members' entry and exit (triggered only for users with upstream audio and video permissions).
Note:
onUserEnter/onUserExit was deprecated in version 6.8 and replaced by onRemoteUserEnterRoom/onRemoteUserLeaveRoom.

How Does TRTC SDK Monitor Network Disconnection and Reconnection?

Listen via the following listening callbacks:
onConnectionLost: The SDK's connection to the server is lost.
onTryToReconnect: The SDK attempts to reconnect to the server.
onConnectionRecovery: The SDK's connection to the server is restored.

Does TRTC SDK Have a First Frame Rendering Callback? Can It Monitor the Start of Picture Rendering and Sound Playback?

Supported. It can be monitored through onFirstVideoFrame/onFirstAudioFrame.

Does the Tencent Real-Time Communication SDK (TRTC SDK) Support the Screenshot Function of Video Footage?

Currently, calling snapshotVideo() on iOS/Android supports screenshot of local and remote video screens.

Is There an Exception When the TRTC SDK (Tencent Real - Time Communication SDK) Is Connected to Peripherals Such As Bluetooth Headsets?

At present, TRTC is compatible with mainstream Bluetooth headphones and peripherals, but there are still compatibility issues on some devices. It is recommended to use the official Demo and WeChat/QQ audio and video calls to test and compare whether they are all normal.

How to Obtain Information Such As Uplink and Downlink Bitrate, Resolution, Packet Loss Rate, and Audio Sample Rate During TRTC (Tencent Real - Time Communication) SDK Audio and Video Process?

These statistical information can be obtained through the SDK API onStatistics().

Does the playBGM() Interface of the Real-Time Audio and Video SDK (TRTC SDK) Support Online Music?

Currently, only local music is supported. It can be downloaded to the local device first and then played by calling playBGM().

Does TRTC (Tencent Real-Time Communication) SDK Support Setting Local Audio Capturing Volume? Does It Support Setting Playback Volume For Each Remote User?

Supported. The audio capturing volume of the SDK can be set through the setAudioCaptureVolume() API, and the playback volume of a remote user can be set through the setRemoteAudioVolume() API.

Difference Between stopLocalPreview and muteLocalVideo?

stopLocalPreview stops local video capture. After calling this API, both the local and remote screens will go black.
muteLocalVideo is to set whether to send one's own video footage to the backend. After calling this API, the footage watched by other users will turn into a black screen, but one can still see the footage in the local preview.

Difference Between stopLocalAudio and muteLocalAudio?

stopLocalAudio stops the collection and uplink of local audio.
muteLocalAudio does not stop sending audio and video data; instead, it continues to send muted data packets with extremely low bitrate.

What Resolutions Does the Real - Time Audio and Video SDK (TRTC SDK) Support?

It is recommended to refer to Set Picture Quality to configure the resolution for a more appropriate picture quality.

How to Set the Upstream Video Bitrate, Resolution, and Frame Rate For the Real-Time Audio and Video SDK (TRTC SDK)?

The videoResolution (resolution), videoFps (frame rate), and videoBitrate (bitrate) in the TRTCVideoEncParam parameters can be set through the setVideoEncoderParam() API of TRTCCloud.

How Is the Control of Screen Angle and Orientation in TRTC SDK Achieved?

How to Achieve Landscape Video Call?

How to Adjust When the Local and Remote Screen Orientations of TRTC SDK Are Inconsistent?

Are There Any Recommended Parameter Configurations Related to Picture Quality (Bitrate, Resolution, Frame Rate) For the Tencent Real-Time Communication SDK (TRTC SDK)?

For details, see Set Picture Quality.

Does TRTC (Tencent Real-Time Communication) SDK Support Network Speed Measurement? How to Operate?

For details, see Pre-call Network Test.

Does TRTC (Tencent Real-Time Communication) SDK Support Permission Validation For Rooms, Such As Scenarios Where Only Members Can Enter?

Supported. For details, see Enable Advanced Permission Control.

Does the Audio and Video Stream of TRTC SDK Support Watching By Pulling Stream Through CDN?

Supported. For details, see Implement CDN Live Streaming Viewing.

What Formats Does TRTC SDK'S Custom Rendering Support?

iOS supports i420, NV12 and BGRA.
Android supports I420 and texture2d.

What Is Tencent Real - Time Communication SDK (TRTC SDK)?

Tencent Real-Time Communication SDK (TRTC SDK) is one of the sub-products of Audio/Video Terminal SDK (Tencent Video Cube), including a feature module of Audio/Video Call. It uses the same underlying basic module as Tencent Real-Time Communication for video products. TRTC SDK focuses on cross-platform interoperability multi-person audio/video call and low-latency interactive live streaming solutions, aiming to help developers quickly build low-cost, low-latency, and high-quality audio/video interactive solutions.

How to Experience the TRTC SDK Demo?

For details, see Demo Trial.

How to Quickly Get Started With TRTC SDK?

Tencent Real-Time Communication SDK (TRTC SDK) provides you with Demo source code for various platforms. You can quickly build your own small application in a very short time. For details, see Getting Started.

How Does TRTC SDK Achieve Cloud Recording and Replay?

For details, see Cloud Recording and Replay.

Does TRTC (Tencent Real-Time Communication) SDK Support Disconnect and Reconnect?

The SDK supports an infinite reconnection mechanism for users in case of disconnection. The specific connection status and processing logic during the connection process are as follows. The following figure shows the listening callback events received from when user Userid1 joins the channel, to when the connection is interrupted, and then to when rejoining the room:
image


Detailed Description:
T1: The user-side initiates an API call to the enterRoom interface to make a room entry request.
T2: Receive the onEnterRoom callback.
T3: If the client is disconnected due to a network issue, the SDK will try to re-enter the room.
T4: If no connection to the Server-side is established for 8 consecutive seconds, receive the onConnectionLost onTryToReconnect callback.
T5: Then, if there is no connection to the server for 3 consecutive seconds, receive the onTryToReconnect retry callback.
T6: Then, every 24 seconds, receive the onTryToReconnect retry callback.
T7: Reconnect successfully at any time during the disconnection period and receive the onConnectionRecovery recovery callback.