当前位置:网站首页>Summary of common problems of real-time audio and video TRTC - quality

Summary of common problems of real-time audio and video TRTC - quality

2022-06-24 03:20:00 Tencent video cloud Zachary

Tencent real time audio and video (Tencent Real-Time Communication,TRTC) Tencent cloud is based on QQ Over the past decade, he has accumulated experience in audio and video communication technology , Combined with Tencent browsing service TBS WebRTC Ability and Tencent real-time audio and video SDK , Provide customers with multi platform interoperability, high-quality and customizable services ** Real time audio and video interworking service ** Solution .

In order to facilitate developers' technology selection 、 Development integration , The following is a summary of different problem scenarios TRTC FAQ summary , It will be updated continuously in the future , Welcome to feedback .

Quality

1. Play the remote audience picture with a black edge

As shown in the following code , Play the picture rendering mode selection of the remote audience TRTC_VIDEO_RENDER_MODE_FIT Pattern , When rendering controls View When the aspect ratio of is inconsistent with that of the video , There are black edges .

  • Android Sample code
mTRTCCloud.setRemoteViewFillMode(userId, TRTCCloudDef.TRTC_VIDEO_RENDER_MODE_FIT);
mTRTCCloud.startRemoteView(userId, renderView);
  • iOS Sample code
[_trtc startRemoteView:userId view:remoteView];
[_trtc setRemoteViewFillMode:userId mode:TRTCVideoFillMode_Fit];

Solution

1. Make sure that the rendering controls View The width and height are consistent with the video width and height

2. Rendering mode selection TRTC_VIDEO_RENDER_MODE_FIT, But the picture may be stretched and cropped .

2. Play the remote audience picture and Caton appears

1. Check the network , It is recommended to replace the network

2. find roomid、userid , Then go to the console Monitoring instrument cluster , Independently query the user's stuck status .

3. Failed to turn on the camera

  • Confirm whether the camera permission is granted
  • If the device is a TV 、 Boxes, etc , The camera used is externally connected . at present TRTCSDK It supports the identification of external cameras . therefore , It is necessary to confirm whether the camera connector and the equipment are in good contact .

4. preview / The playback screen will rotate

Use TRTCSDK Camera acquisition

  1. Proposed update SDK Version to the latest version .
  2. In case of special equipment , You can use the local preview screen to render the angle interface setLocalViewRotation , Rendering angle interface of remote video picture setRemoteViewRotation , Set the image rendering angle interface output by the encoder setVideoEncoderRotation Adjustment . For the specific interface description file, see Video rotation

Use custom video capture

  1. Proposed update SDK Version to the latest version .
  2. Confirm that the angle of the video picture to be collected is correct .
  3. Fill video data into TRTCSDK, To check whether or not to give TRTCCloudDef.TRTCVideoFrame Set the rotation angle
  4. In case of special equipment , You can use the local preview screen to render the angle interface setLocalViewRotation , Rendering angle interface of remote video picture setRemoteViewRotation , Set the image rendering angle interface output by the encoder setVideoEncoderRotation Adjustment . For the specific interface description file, see Video rotation

5. Video mirroring problem

Use the front camera for video calls , There will be a mirror effect , So the local preview and remote audience picture are upside down . If the developer wants to make the two images consistent , You can refer to the documentation Use the front camera for video calls , The local preview and remote viewer images are reversed ?

6. How to push the flow across the screen

Developers may use a TV device or push streaming across the screen due to the needs of the scene , Specific implementation can refer to Android TRTC Realize horizontal video call file .

7. Kill process , How to confirm whether the anchor is in the live broadcast ?

This scenario applies to iOS/Mac、Android 、Windows platform .

stay TRTC There are upstream users in the room , When an application process is killed or actively disconnected from the network , exceed 30 Seconds later , The anchor has not resumed streaming .TRTC Other users in the room will receive the anchor ( There are users who push upstream ) Exit the callback of the room .

8. A black screen appears in the live broadcast 、 Blurred screen 、 Green screen , What's the reason ?

The reason for the black screen :

1) Playback failed or decoding failed , See how to handle playback failure .

2) Metadata problem , such as metadata There is only audio stream information in , But the actual data includes both audio and video

video ; Or the initial data is only audio , But after playing for a period of time, video information is added . such

It is generally recommended to modify the source stream metadata Information .

3) There is no picture information in the video coding data , Just like SEI And so on , There is no picture for decoding , since

However, the screen went blank , This kind of video data is usually customized .

Blurred screen 、 The reason for the green screen :

1) It is usually lost I Frames cause , because P The frame and B The decoding of frames depends on I frame , If I The frame is lost ,

P The frame and B All frames will fail to decode , So the picture will spend the screen 、 Tardy shadow 、 Green screen, etc , Use different first The player is like ffplay、VLC、Potplayer Play the same stream at the same time , If the player has flowers screen 、 The green screen , Usually there is a problem with the audio and video source stream , You need to check the source stream .

2) Metadata change , Most players usually parse only once before decoding metadata Set decoding parameters , When the picture changes , For example, the resolution has changed , But the player decodes The number has not been reconfigured , It may lead to flower screen 、 Green screen , In this case , The best way is to push the stream end The coding parameters will not be changed during the live broadcast , So it won't cause metadata Modification of information .

3) Hardware codec compatibility problem , This kind of situation usually occurs in Android On the device , some Android The hardware codec of the device is not well implemented , Poor compatibility . This situation , The best way , Change soft weave soft Solution comparison .

4) The color format of the streaming end and the playback end is inconsistent, resulting in , For example, the streaming end uses NV12, The player supports I420, When decoding, it will be displayed as a flower screen because the color format is inconsistent 、 Green screen, etc . this Under different circumstances , Unify the color format at both ends of the push-pull stream .

9. TRTC What are the technical statistical indicators ?

This scenario applies to iOS/Mac、Android 、Windows platform .

SDK Provide callback methods onStatistics(TRTCStatistics statics), Every time 2 Technical indicators are returned once every second . Including current appCpu(App Of CPU Usage rate )、systemCpu( Of the current system CPU Usage rate )、rtt( Delay )、upLoss( Uplink packet loss rate )、downLoss( Downlink packet loss rate ) And audio and video statistics of local members and remote members , For specific parameters, please refer to TRTCStatistics Type description document .

Technical support

Dear Developer , If you encounter any problems in using the product , Welcome to cloud + Community and GitHub Ask or inquire about historical problems and solutions .

  • ** cloud + Queries and questions on the Q & A pages of various products in the community :**

Real time audio and video :https://cloud.tencent.com/developer/tag/10373?entry=ask

Instant messaging :https://cloud.tencent.com/developer/tag/126?entry=ask

Live Mobile :https://cloud.tencent.com/developer/tag/10374?entry=ask

Short video :https://cloud.tencent.com/developer/tag/10375?entry=ask

Super player :https://cloud.tencent.com/developer/tag/10855?entry=ask

Interactive live broadcast :https://cloud.tencent.com/developer/tag/10379?entry=ask

  • **GitHub Of issue page :**

Live Mobile :https://github.com/tencentyun/MLVBSDK/issues

Real time audio and video :https://github.com/tencentyun/TRTCSDK/issues

player :https://github.com/tencentyun/SuperPlayer\_Android/issueshttps://github.com/tencentyun/SuperPlayer\_iOS/issues

Instant messaging IM:https://github.com/tencentyun/TIMSDK/issues

原网站

版权声明
本文为[Tencent video cloud Zachary]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/10/20211010202013399G.html