tencent cloud

Tencent Real-Time Communication

Release Notes and Announcements
Release Notes
Recent Product Announcement
TRTC Live (TUILiveKit) Product Launch Announcement
TRTC Conference Official Editions Launched
The commercial version of Conference is coming soon
Terms and Conditions Applicable to $9.9 Starter Package
Rules for the "First Subscription $100 Discount" Promotion
Announcement on the Start of Beta Testing for Multi-person Audio and Video Conference
TRTC Call Official Editions Launched
License Required for Video Playback in New Version of LiteAV SDK
TRTC to Offer Monthly Packages
Product Introduction
Overview
Concepts
Features
Strengths
Use Cases
Performance Statistics
Tencent RTC Quickplay: Experience Ultimate Real-Time Audio and Video Interaction!
Purchase Guide
Billing Overview
Free Minutes
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
FAQs
Refund Instructions
User Tutorial
Free Demo
Call
Overview
Activate the Service
Run Demo
Integration
Offline Call Push
Conversational Chat
On-Cloud Recording
AI Noise Reduction
UI Customization
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
Release Notes
FAQs
Conference
Overview(TUIRoomKit)
Activate the Service (TUIRoomKit)
Run Demo(TUIRoomKit)
Integration(TUIRoomKit)
Screen Sharing (TUIRoomKit)
Schedule a meeting (TUIRoomKit)
In-meeting Call (TUIRoomKit)
UI Customization(TUIRoomKit)
Virtual Background (TUIRoomKit)
Conference Control (TUIRoomKit)
Cloud Recording (TUIRoomKit)
AI Noise Reduction (TUIRoomKit)
In-Conference Chat (TUIRoomKit)
Robot Streaming (TUIRoomKit)
Enhanced Features (TUIRoomKit)
Client APIs (TUIRoomKit)
Server APIs (TUIRoomKit)
FAQs (TUIRoomKit)
Error Code (TUIRoomKit)
SDK Update Log (TUIRoomKit)
Live
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Run Demo
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK Download
API Examples
Usage Guidelines
API Reference Manual
Advanced Features
AI Integration
Overview
Configure MCP Server
Install Skills
Integration Guide
FAQ
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
Console Guide
Application Management
Package Management
Usage Statistics
Monitoring Dashboard
Development Assistance
Solution
Real-Time Chorus
FAQs
Migration Guide
Billing
Features
UserSig
Firewall Restrictions
How to Downsize Installation Package
Android and iOS
Web
Flutter
Electron
TRTCCalling for Web
Audio and Video Quality
Others
Legacy Documentation
RTC RoomEngine SDK(Old)
Integrating TUIRoom (Web)
Integrating TUIRoom (Android)
Integrating TUIRoom (iOS)
Integrating TUIRoom (Flutter)
Integrating TUIRoom (Electron)
TUIRoom APIs
On-Cloud Recording and Playback (Old)
RTC Analytics Monthly Packages (Previous Version)
Protocols and Policies
Compliance
Security White Paper
Notes on Information Security
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC Policy
Privacy Policy
Data Processing And Security Agreement
Glossary

Video Settings

PDF
Focus Mode
Font Size
Last updated: 2025-06-23 14:10:35
this document primarily introduces how to use RTC Room Engine SDK to implement video setting related features.

Prerequisites

Before using the video setting related features provided by RTC Room Engine SDK, you need to log in to the SDK.

User Guide

Turn On/Off Local Camera

iOS
Android
You can turn on or off your local camera by calling two APIs: openLocalCamera and closeLocalCamera.
The openLocalCamera API requires the input of two parameters: select front or rear camera isFront and video quality quality. isFront is a Boolean value, where true means opening the front camera and false means opening the rear camera. quality is an enumeration of type TUIVideoQuality.
Enumeration Value Type
Meaning
quality360P
Low-definition 360P
quality540P
Standard-definition 540P
quality720P
HD 720P
quality1080P
Ultra HD 1080P
Below is an example code for opening the local microphone and closing the local camera, taking opening the front camera and setting the video quality to quality1080P as an example.
You can turn on or off your local camera by calling two APIs: openLocalCamera and closeLocalCamera.
The openLocalCamera API requires the input of two parameters: select front or rear camera isFront and video quality quality. isFront is a Boolean value, where true means opening the front camera and false means opening the rear camera. quality is an enumeration of type VideoQuality.
Enumeration Value Type
Meaning
Q_360P
Low-definition 360P
Q_540P
Standard-definition 540P
Q_720P
HD 720P
Q_1080P
Ultra HD 1080P
Below is an example code for opening the local microphone and closing the local camera, taking opening the front camera and setting the video quality to Q_1080P as an example.
iOS
Android
import RTCRoomEngine

let roomEngine = TUIRoomEngine.sharedInstance()

// Turn on local camera
let isFrontCamera = true
let videoQuality: TUIVideoQuality = .quality1080P
roomEngine.openLocalCamera(isFront: isFrontCamera, quality: videoQuality) {
// Successful activation
} onError: { code, message in
// Activation fail
}

// Turn off local camera
roomEngine.closeLocalCamera()
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();

// Turn on local camera
boolean isFrontCamera = true;
TUIRoomDefine.VideoQuality videoQuality = TUIRoomDefine.VideoQuality.Q_1080P;
roomEngine.openLocalCamera(isFrontCamera, videoQuality, new TUIRoomDefine.ActionCallback() {
@Override
public void onSuccess() {
// Successful activation
}
@Override
public void onError(TUICommonDefine.Error error, String message) {
// Activation fail
}
});

// Turn off local camera
roomEngine.closeLocalCamera();

Set Local Video Image Mirror

The following is an example of turning on local video mirror. You can turn on/off the local video mirror through the following code.
iOS
Android
import RTCRoomEngine
import TXLiteAVSDK_Professional

let trtcCloud = TUIRoomEngine.sharedInstance().getTRTCCloud()

let params = TRTCRenderParams()
params.mirrorType =.enable // To turn off the mirror, just set this parameter to.disable here
trtcCloud.setLocalRenderParams(params)
trtcCloud.setVideoEncoderMirror(true)
TRTCCloud trtcCloud = TUIRoomEngine.sharedInstance().getTRTCCloud();
TRTCCloudDef.TRTCRenderParams params = new TRTCCloudDef.TRTCRenderParams();
params.mirrorType = TRTC_VIDEO_MIRROR_TYPE_ENABLE; // To turn off the mirror, just set this parameter to TRTC_VIDEO_MIRROR_TYPE_DISABLE here
trtcCloud.setLocalRenderParams(params);
trtcCloud.setVideoEncoderMirror(true);

Switch Camera

When calling the switchCamera API to switch the camera, a Bool parameter frontCamera is required. Passing in true switches to the front-facing camera, and passing in false switches to the rear camera. The following is the example code for switching to the front-facing camera:
iOS
Android
import RTCRoomEngine

TUIRoomEngine.sharedInstance().getMediaDeviceManager().switchCamera(true)
TUIRoomEngine.sharedInstance().getMediaDeviceManager().switchCamera(true);

Update Local Video Encoding Quality

iOS
Android
When updating the local video encoding quality, the parameter type TUIVideoQuality required is the same as mentioned above. Below is an example of using the default mode to call the updateVideoQuality API to update the encoding quality of the local video:
import RTCRoomEngine

let videoQuality: TUIVideoQuality = .quality1080P
TUIRoomEngine.sharedInstance().updateVideoQuality(videoQuality)
When updating the local video encoding quality, the parameter type VideoQuality required is the same as mentioned above. Below is an example of using the default mode to call the updateVideoQuality API to update the encoding quality of the local video:
TUIRoomDefine.VideoQuality videoQuality = TUIRoomDefine.VideoQuality.Q_1080P;
TUIRoomEngine.sharedInstance().updateVideoQuality(videoQuality);

Set Encoding Parameters for Video Encoder

iOS
Android
When setting the encoding parameters for the video encoder, the parameter type TUIRoomVideoEncoderParams is required. Below is an example of using the default mode to call the updateVideoQualityEx API to update the encoding quality of the local video:
Introduction to TUIRoomVideoEncoderParams Parameters
Parameter Item
Parameter Name
Resolution
videoResolution
Frame Rate
fps
Resolution Mode
resolutionMode
Maximum Bit Rate
bitrate
import RTCRoomEngine

let roomEngine = TUIRoomEngine.sharedInstance()

let params = TUIRoomVideoEncoderParams()
params.fps = 10 //Here replace it with the value actually required by you
params.resolutionMode =.portrait //Portrait resolution
params.bitrate =.1600 //Here replace it with the value actually required here
params.videoResolution =.quality720P //Here replace it with the value you need

roomEngine.updateVideoQualityEx(streamType: .screenStream, params: params)

When setting the encoding parameters for the video encoder, the parameter type TUIRoomDefine.RoomVideoEncoderParams is required. Below is an example of using the default mode to call the updateVideoQualityEx API to update the encoding quality of the local video:
Introduction to TUIRoomDefine.RoomVideoEncoderParams Parameters
Parameter Item
Parameter Name
Resolution
videoResolution
Frame Rate
fps
Resolution Mode
resolutionMode
Maximum Bit Rate
bitrate
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();

TUIRoomDefine.RoomVideoEncoderParams params = new TUIRoomDefine.RoomVideoEncoderParams();
params.videoResolution = TUIRoomDefine.VideoQuality.Q_720P; //Here replace it with the actual value you need
params.bitrate = 1600; //Here replace it with the actual value you need
params.fps = 10; //Here replace it with the actual value you need
params.resolutionMode = TUIRoomDefine.ResolutionMode.PORTRAIT; //Portrait resolution

roomEngine.updateVideoQualityEx(TUIRoomDefine.RoomVideoEncoderParams params)

Start/Stop Pushing Local Video

When you are in the live streaming room, you may need to start/stop pushing your local video. You can achieve this by calling the following APIs:
iOS
Android
import RTCRoomEngine

let roomEngine = TUIRoomEngine.sharedInstance()

// Start pushing local video (enabled by default)
roomEngine.startPushLocalVideo()

// Stop pushing local video
roomEngine.stopPushLocalVideo()
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();

// Start pushing local video (enabled by default)
roomEngine.startPushLocalVideo();

// Stop pushing local video
roomEngine.stopPushLocalVideo();
Note:
Inside the room, if you have already opened your camera and called the above API to start/stop pushing local video, the SDK will notify users in the room through TUIRoomObserver with the onUserVideoStateChanged callback.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback