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.

Audio and Video Quality Related

Last updated: 2025-03-17 15:27:08

Video Issues

How to Remove the Black Border From TRTC Video Footage?

Set TRTCVideoFillMode_Fill (fill) to solve this problem. TRTC video rendering modes are divided into fill and adapt. Local rendering images can be set through setLocalViewFillMode(), and remote rendering images can be set through setRemoteViewFillMode:
TRTCVideoFillMode_Fill: The image fills the screen, and the part of the video that exceeds the display window will be cropped, so the picture may not be complete.
TRTCVideoFillMode_Fit: The long side of the image fills the screen, and the short side area will be filled with black, but the content of the picture is definitely complete.

How to Troubleshoot Lag in TRTC?

You can view the call quality through the corresponding RoomID and UserID on the Dashboard page of the Tencent Real-Time Communication console:
View the situation of sender and recipient users from the perspective of the recipient.
Check whether the packet loss rate of the sender and recipient is high. If the packet loss rate is too high, it is generally caused by unstable network conditions, resulting in Lag.
Check the frame rate and CPU occupancy rate. Low frame rate and high CPU utilization can both lead to Lag.

How to Troubleshoot Poor Video Quality in TRTC, Such As Blurriness and Mosaic?

Clarity is mainly related to bitrate. Check whether the SDK bitrate is configured relatively low. If the resolution is high but the bitrate is low, it is easy to produce a mosaic phenomenon.
TRTC will dynamically adjust the bitrate and resolution through the cloud-based QOS flow control policy according to network conditions. When the network is poor, it is easy to reduce the bitrate, resulting in decreased clarity.
Check whether the VideoCall mode or Live mode is used when entering the room. For call scenarios, the VideoCall mode focuses on low latency and smoothness. Therefore, in weak network conditions, it is more likely to sacrifice video quality to ensure smoothness. For scenarios where video quality is more important, it is recommended to use the Live mode.

Why Are the Local Screen and Remote Screen in TRTC Reversed Left and Right?

The locally collected image is mirrored by default. On the App side, you can set it through the setLocalViewMirror API, which only changes the mirror mode of the local camera preview image; you can also set the mirror mode of the encoder output image through the setVideoEncoderMirror API, which does not change the local camera preview image but will change the image effect seen by the user on the other end (as well as the server-recorded image). On the Web side, you can modify the mirror parameter through the createStream API to set it.

TRTC Setting Video Encoding Output Orientation Has No Effect?

You need to set setGSensorMode() to TRTCGSensorMode_Disable to disable the gravity sensor. Otherwise, after calling setVideoEncoderRotation, the picture seen by the remote user will not change.

TRTC Normal Uplink Has Data, Why Does Bypass Streaming Fail and No Image Can Be Seen?

Please confirm whether automatic bypass push stream has been enabled in Application Management > Feature Configuration.

Preview/Playback Image Appears Rotated?

Use TRTCSDK camera collection:
It is recommended to update the SDK version to the latest version.
For special devices, you can use the local preview frame rotation API setLocalViewRotation, the remote video frame rotation API setRemoteViewRotation, and the encoder output frame rotation API setVideoEncoderRotation for adjustment. For detailed instructions on using these APIs, see video frame rotation.
Use custom video capture feature
It is recommended to update the SDK version to the latest version.
Confirm whether the screen angle when collecting video is correct.
Fill in the video data for TRTCSDK and check whether the rotation angle is set for TRTCCloudDef.TRTCVideoFrame.
For special devices, you can use the local preview frame rotation API setLocalViewRotation, the remote video frame rotation API setRemoteViewRotation, and the encoder output frame rotation API setVideoEncoderRotation for adjustment. For detailed instructions on using these APIs, see video frame rotation.

Video Has a Mirror Problem?

When using the front camera for a video call, there will be a mirror effect, so the local preview and the remote viewer's picture are reversed left to right. If you want the pictures on both ends to be consistent, please refer to When using the front camera for a video call, the local preview and the remote viewer's picture are reversed left to right.

How to Stream in Landscape Mode?

Developers may use devices such as TVs or need to do horizontal streaming due to scene requirements. For specific implementation, please refer to Android TRTC Implements Landscape Video Call.

What Causes a Black Screen During Live Stream Playback?

Playback failure or decoding failed. See Solutions for playback failure.
Metadata issues, such as only audio stream information in metadata but both audio and video in actual data; or only audio at the start of the data and then video information added after a period of playback. In such cases, it is generally recommended to modify the metadata information of the source stream.
When there is no picture information in the video encoding data and only frames like SEI are present, there will be no picture during decoding, resulting in a black screen. This is generally custom video data.

What Are the Reasons For Screen Glitches or Green Screens During Live Streams?

Generally, it is caused by the loss of I-frame, because the decoding of P-frames and B-frames depends on I-frames. If the I-frame is lost, both P-frames and B-frames will fail to decode, resulting in screen glitches, ghosting, green screens, etc. First, use different players such as ffplay, VLC, and Potplayer to play the same stream simultaneously. If all players show screen glitches or green screens, usually there is a problem with the audio and video source stream, and the source stream needs to be checked.
Metadata changes. Most players generally parse the metadata settings and decoding parameters only once before starting decoding. When the picture changes, for example, the resolution changes, but the player's decoding parameters are not reconfigured, it may cause screen glitches or green screen. In this case, the best way is for the streaming side not to change the encoding parameters during live streaming, so as not to cause modification of metadata information.
Compatibility issues of hardware encoding and decoding. This kind of situation usually occurs on Android devices. The hardware encoders and decoders of some Android devices are poorly implemented and have poor compatibility. In this case, the best way is to switch to software encoding and decoding for comparison.
When the color formats of the streaming side and the playback side are inconsistent, for example, if the streaming side uses NV12 while the playback side supports I420, screen glitches or green screens may occur during decoding due to the color format inconsistency. In this case, unify the color formats of the streaming and playback ends.


Audio Issues

Why Is the Sound Very Low When Using the On-Demand Player TXVodPlayer During a TRTC Call?

Set the system volume type used during a call through the setSystemVolumeType API. Set it to the media volume mode TRTCSystemVolumeTypeMedia to solve the problem.

How to Select Media Volume and Call Volume?

Through the setSystemVolumeType API, you can choose call volume and media volume independently.
TRTCAudioVolumeTypeAuto: Default type, call volume when speaking, media volume when not speaking.
TRTCAudioVolumeTypeVOIP: Always use call volume.
TRTCAudioVolumeTypeMedia: Always use media volume.

Handling No Sound in TRTC Upstream and Downstream

Handling Low Volume

If all the audience hear low sound, it is caused by uplink factors:
Check whether the volume value of the setCurrentDeviceVolume API for Windows and mac and the setAudioCaptureVolume API for all platforms is less than 50. You can appropriately increase the volume.
Check whether the AGC automatic gain of 3A processing is enabled.
Check whether it is caused by Bluetooth headphones.
If some of the audience hear low sound, it is caused by downlink factors:
Check whether the volume value of the setAudioPlayoutVolume API and the setCurrentDeviceVolume API is less than 50. You can appropriately increase the volume.
Mobile app can check whether the setAudioRoute API has been called to switch to receiver playback.

Is There Sound Lag, Interruption or Intermittence?

Open Monitoring Dashboard and view in the Audio tab:
If the CPU of the "device status" of the recipient and the sender exceeds 90%, it is recommended to close other background programs.
If there is significant packet loss in audio upstream and downstream and the rtt value fluctuates greatly, it indicates that the current user's network quality is poor. It is recommended to switch to a stable network.

Why Is There an Echo?

When the devices of both parties are too close to each other, it is normal. Please keep a greater distance from each other during testing; whether the AEC echo cancellation of 3A processing has been accidentally turned off.

Poor Sound Quality or Fluctuating Volume?

If you have connected an external sound card and enabled in-ear monitoring, this issue may occur during mic connection. It is recommended to disable in-ear monitoring when using an external sound card, as the sound card generally has its own in-ear monitoring function.

Echo, Noise, or Low Volume During Web Call?

When the devices of both parties are too close to each other, it is normal. Please keep A greater distance from each other during testing. When the other end hears echo, noise, or interference in the sound from the Web end, it indicates that the 3A processing on the Web end is not effective. If you use the browser native getUserMedia API for custom capture, you need to manually set the 3A parameters:
echoCancellation: Echo cancellation switch.
noiseSuppression: Noise suppression switch.
autoGainControl: Automatic gain control switch. For detailed settings, see Media tracking constraints.
If you use the TRTC.createStream API for capture, there is no need to manually set the 3A parameters. The SDK enables 3A by default.


Others

How Does TRTC Monitor Network Status and Implement the Feature of Displaying Signal Strength?

You can use onNetworkQuality() to monitor the uplink and downstream quality of the current network. Taking Android as an example, see TRTC-API-Example to implement the signal strength feature.

Why Does an Exception Such As the Device Camera or Microphone Being Occupied Occur?

Calling the exitRoom() API will execute the relevant logic for exiting the room, such as releasing audio and video device resources and codec resources. The release of hardware devices is an asynchronous operation. After the resources are released, the SDK will notify the upper layer through the onExitRoom() callback in TRTCCloudListener. If you want to call enterRoom() again or switch to other audio and video SDKs, wait for the onExitRoom() callback to arrive before performing relevant operations.

How to Judge If the Camera Is Successfully Turned On?

Through the callback method onCameraDidReady, when this callback is received, it indicates that the camera is ready.

How to Judge If the Microphone Is Successfully Turned On?

Through the callback method onMicDidReady, when this callback is received, it indicates that the microphone is ready.

Failed to Open the Camera?

Confirm whether the camera permission is granted
If the device is a TV, box, etc., the camera used is external. Currently, TRTCSDK supports recognizing external cameras. Therefore, it is necessary to confirm whether the camera connector is in good contact with the device.

What Are the Technical Statistics Indicators of TRTC?

Note:
This scenario is applicable to iOS/Mac, Android, and Windows platforms.
The SDK provides a callback method onStatistics(TRTCStatistics statics), which reports technical metrics every 2 seconds. This includes the current appCpu (CPU utilization of the App), systemCpu (CPU utilization of the current system), rtt (latency), upLoss (uplink packet loss rate), downLoss (downlink packet loss rate), and audio/video statistics for local and remote members. For specific parameters, see TRTCStatistics type description.