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

Audio and Video Quality

1. Video

How do I remove the black bars in a TRTC video image?

You can solve this problem by setting TRTCVideoFillMode_Fill (rendering mode). TRTC has two video rendering modes: fill and fit. You can set the rendering mode of the local image using setLocalViewFillMode() and that of a remote image using setRemoteViewFillMode.
TRTCVideoFillMode_Fill: The image fills the entire screen, and the excess parts are cropped. The image may not be displayed in whole.
TRTCVideoFillMode_Fit: The image is stretched as large as the long side can go, and the blank area is filled with black bars. The image is displayed in whole.


How do I fix stutter?

You can check call quality by room ID or user ID in Monitoring Dashboard in the TRTC console.
Check the send and receive statistics from the recipient’s perspective.
Check the send and receive packet loss. High packet loss suggest that the stutter may be caused by unstable network connections.
Check the frame rate and CPU usage. Both low frame rates and high CPU usage can cause stutter.


How do I fix low-quality, blurry and pixelated videos?

Resolution is mainly associated with bitrate. Check whether the bitrate is set too low. Pixelation tends to occur when resolution is high but bitrate low.
With its on-cloud QoS control policy, TRTC dynamically adjusts bitrate and resolution based on network conditions. It reduces the bitrate in case of poor network connections, which leads to decreased resolution.
Check whether the VideoCall or Live mode is used during room entry. Because the VideoCall mode is designed for calls and features low latency and smoothness, it tends to sacrifice video quality for smoothness when network connections are poor. We recommend that you use the Live mode for application scenarios with high requirements on video quality.


Why are the local preview and image seen by remote users horizontally reversed?

Images captured by the local camera are mirrored by default. For native applications, you can use setLocalViewMirror to set the mirror mode of the local preview, or setVideoEncoderMirror to set the mirror mode of encoded images, that is, images seen by remote users and recorded by the server. On web, you can set the mirror mode by specifying the mirror parameter when calling createStream.


Why doesn’t my orientation setting for encoded video take effect?

You need to set setGSensorMode() to TRTCGSensorMode_Disable to disable gravity sensing; otherwise, the orientation of video seen by remote users will not change even after you call setVideoEncoderRotation.


Upstream data transfer is normal, but why can’t I pull data from CDNs and why can’t remote users see an image?

Make sure you have enabled relayed to CDN in Application Management > Function Configuration.


What should I do if preview/playback images are rotated?

If you use the TRTC SDK to capture camera data:
Update the TRTC SDK to the latest version.
If you use special devices, you can call the local preview rotation API setLocalViewRotation, remote image rotation API setRemoteViewRotation, and encoded image rotation API setVideoEncoderRotation to adjust the rotation. For detailed directions, see Video Rotation.
If you capture video data by yourself:
Update the TRTC SDK to the latest version.
Check the original rotation of the video you capture.
Send the video data to the TRTC SDK and check whether a rotation angle is specified for TRTCCloudDef.TRTCVideoFrame.
If you use special devices, you can call the local preview rotation API setLocalViewRotation, remote image rotation API setRemoteViewRotation, and encoded image rotation API setVideoEncoderRotation to adjust the rotation. For detailed directions, see Video Rotation.

Why are videos mirrored?

When a user uses the front camera, his or her video will be mirrored, and the local preview and video seen by remote users will be horizontally reversed.


How do I publish streams in landscape mode?

You may want to publish streams in landscape mode in certain scenarios, for example, if you use TVs for live streaming. For how to implement this, see Video Rotation.


What are the causes of black screen during live streaming?

Playback or decoding failure. Please refer to the solutions to playback failure.
Metadata issue. For example, the metadata contains only audio stream information, but there is also video in the actual data or there is only audio at the beginning but video is added later. If this is the case, we recommend you modify the metadata of the source stream.
There are only frames such as SEI but no image information in encoded video data. As a result, there are no images to decode, hence the black screen. This usually occurs with custom video data.

What are the causes of blurry or green screen during live streaming?

Missing of I-frames. Both P- and B-frames rely on I-frames to decode, so if I-frames are missing, the decoding of P- and B-frames will fail, resulting in ghosting, or blurry or green screen. Use different players such as FFplay, VLC, and PotPlayer to play the stream at the same time. If blurry or green screen occurs on all players, the problem probably lies in the source stream, and you need to check your source stream.
Change of metadata. Most players parse metadata only before decoding to configure decoding parameters. In case of video changes, for example, if the resolution changes, but the player doesn’t update the decoding parameters, the blurry or green screen issue may occur. The best solution to this issue is keeping encoding parameters unchanged during live streaming so that the metadata does not change.
Compatibility issues of hardware encoders/decoders. This problem is usually found on Android devices. The hardware encoders/decoders of some Android devices are not well implemented and has poor compatibility. If this is the case, we recommend you switch to software encoders/decoders.
Use of different color formats for publishing and playback. For example, if NV12 is used for publishing and I420 is used for playback, the issue of blurry or green screen may occur during decoding. To solve this, make sure the same color format is used for publishing and playback.

2. Audio

What should I do if the audio volume is low when I use TXVodPlayer to play videos during a TRTC call?

Call the setSystemVolumeTyp API to set the system volume type used during the call to TRTCSystemVolumeTypeMedia (media volume mode).

How do I select the media or call volume type?

You can call the setSystemVolumeType API to select the media or call volume type as needed.
TRTCAudioVolumeTypeAuto (default): The call volume type is used when the mic is on and the media volume type is used when the mic is off.
TRTCAudioVolumeTypeVOIP: The call volume type is always used.
TRTCAudioVolumeTypeMedia: The media volume type is always used.

What should I do if the audio volume is low?

If the volume is low for all users, then it is an upstream issue.
Check whether volume is set to lower than 50 in the setCurrentDeviceVolume API for Windows and macOS or the setAudioCaptureVolume API for all platforms. If so, set it to a larger value.
Check whether automatic gain control (AGC) is enabled.
Check whether the use of Bluetooth earphones caused the problem.
If the volume is low for only some users, then it is a downstream issue.
Check whether volume is set to lower than 50 in the setAudioPlayoutVolume or setCurrentDeviceVolume API. If so, set it to a larger value.
On mobile phones, check whether the setAudioRoute API was called to switch to the receiver for playback.

What should I do if audio stutters?

Open Monitoring Dashboard, go to the end-to-end details page, and select the Audio tab.
In Device Status, if the CPU usage of the receiver and sender exceeds 90%, close other processes running in the background.
If there are marked upstream and downstream packet loss and major fluctuations in RTT, it indicates poor network conditions. Change to a different network.

Why do I hear echo?

The echo issue is common if the call participants are close to each other. Please ensure a certain distance between call participants when testing. Also, check whether you have unintentionally disabled acoustic echo cancellation (AEC).

What should I do if audio is of low quality and the volume keeps changing?

This problem occurs if you use an external sound card and enable in-ear monitoring at the same time. This is because sound cards are often built in with in-ear monitoring. Please disable in-ear monitoring when you use an external sound card.

What should I do if there is echo or noise during a call or the volume of a call is small?

The issues are common if the call participants are close to each other. Please ensure a certain distance between call participants when testing. If a non-web client hears echo or noise from a web client, it indicates that 3A is not working on web. If you use the browser’s built-in API getUserMedia for custom capturing, you need to enable 3A manually using the parameters below:
echoCancellation: echo cancellation
noiseSuppression: noise suppression
autoGainControl: automatic gain control
If you use the TRTC.createStream API for capturing, you don’t need to set the 3A parameters manually. The TRTC SDK enables 3A by default.

3. Others

How do I monitor network status and display signal strength in TRTC?

You can use onNetworkQuality() to monitor the current upstream and downstream network quality. To display signal strength, on Android, for example, refer to TRTC-API-Example.

Why is my camera or mic occupied?

When the exitRoom() API is called, logic such as the release of audio/video devices and codecs will be executed. Releasing devices is an async operation. After the release, the SDK will use the onExitRoom() callback in TRTCCloudListener to notify the upper layer. Please wait until you receive the onExitRoom() callback before you call enterRoom() again or switch to another audio/video SDK.

How do I know whether the camera is enabled successfully?

If the onCameraDidReady callback is received, the camera is ready.

How do I know whether the mic is enabled successfully?

If the onMicDidReady callback is received, the mic is ready.

What should I do if the camera fails to be turned on?

Check whether you have granted access to the camera.
The TRTC SDK supports external cameras, which are required if you use TVs or set-top boxes. Check whether the external camera is properly connected to your device.

What technical metrics does TRTC use?

notice
The following applies to iOS, macOS, Android, and Windows.
The TRTC SDK offers the onStatistics (TRTCStatistics statics) callback. Every 2 seconds, the callback returns statistics on technical metrics including appCpu (app CPU usage), systemCpu (system CPU usage), rtt (latency), upLoss (upstream packet loss), downLoss (downstream packet loss), and audio/video statistics of the local user and remote users. For details, see TRTCStatistics.