The monthly "Common Problems of Converged Communication" will meet with you at the end of each month. The monthly magazine mainly includes three major sections: wrong question collection, knowledge gas station, and technical supplements. The cutting-edge information and technical dry goods in the field can speed up your development and contribute to your advanced path.
Overview of the content of this issue
look here! Avoid the pits that others have stepped on!
When listening to music and communicating, the human voice becomes smaller.
After calling the leave room interface, the camera is still in use.
When the audience switches to the microphone linker, they hear the anchor's voice repeating twice.
After the web side bypasses the push stream, the pull stream side cannot pull the stream.
After closing the camera and reopening it, the camera is switched and cannot be maintained.
When using the audio-only call scenario on the web side, no sound can be heard.
Do you know these knowledge points?
Why did the camera fail to open?
How to deal with video blur problem?
Why does the video freeze?
A set of errors
chat room
Difficult problem 1: chat room sound scene, the human voice becomes smaller during the process of listening to music and communicating.
error-prone level: ⭐⭐⭐⭐
Error reason:
The sound volume and vocal volume settings are unreasonable, resulting in poor audio quality at the receiving end.
problem solving ideas:
(1) It is recommended that the volume of setAudioMixingPlaybackVolume should not exceed 25. After that, the experience of voice communication during the audio process may be affected;
(2) adjustRecordingSignalVolume The default volume of this interface is 100, it is recommended not to adjust.
problem 2: calls the leave room interface, the camera is still in use.
error-prone class: ⭐⭐⭐
Wrong question reason:
When using nertc-web-sdk, some interfaces are called repeatedly. Stream.init (initializing the audio and video stream object) is called twice, two different video streams are created locally, and the camera device is used at the same time. When Client.leave (leaving the audio and video room), only one stream's device usage is ended, so the camera is still being used.
problem solving ideas:
In the business, it is necessary to manage the number of calls of Stream.init and the life cycle of the Stream object. Each Stream only needs to be initialized once to ensure the normal use of audio and video.
Interactive live broadcast
Problem 3: viewer switches to the microphone linker, he hears the anchor's voice repeating twice.
error-prone level: ⭐⭐⭐
Error reason:
In the interactive live broadcast application, the switch between the audience and the microphone connection involves the player switching from the CDN to pull the stream to joining the RTC room to subscribe to the anchor's audio and video. After the audience successfully connects to the microphone, they directly join the audio and video room and subscribe to the host's audio and video without stopping the player, causing the host's audio to be played repeatedly from the player and the audio and video room at the same time.
problem solving ideas:
In the interactive live broadcast, the standard implementation process of connecting the microphone to the microphone:
(1) Lianmai succeeded
(2) Exit playback, release the player instance and resources mLivePlayer.release();
(3) Initialize the audio and video and enter the audio and video room
(4) Subscribe to remote audio and video
Difficulty 4: bypasses the push stream on the Web side, occasionally the pull stream side cannot pull the stream.
error-prone level: ⭐⭐⭐
Error reason:
The timing error of pushing the bypass stream (addTasks or updateTasks) and pushing the RTC room stream (publish) resulted in a lack of data sources during interactive live streaming
problem solving ideas:
Before pushing the bypass stream, make sure that the corresponding stream has been successfully published in the RTC room, so you need to call addTasks after publishing is successful;
If the bypass layout also contains streams of other users, then call addTasks or updateTasks after receiving the stream-added/stream-subscribed stream callback of the corresponding user.
General question
problem 5: When using audio and video on , if the camera is turned off and then turned on again, the camera cannot be maintained after being switched.
error-prone level: ⭐⭐⭐
Wrong question reason:
The video switch uses the NERtc#enableLocalVideo() interface. At this time, the front or rear camera is turned on by the frontCamera parameter passed in the last call to setLocalVideoConfig. If you reset the frontCamera parameter in the setLocalVideoConfig interface after calling enableLocalVideo, then Take this parameter as the criterion to open the corresponding camera.
problem solving ideas:
setLocalVideoConfig is a full parameter configuration interface. When this interface is called repeatedly, the SDK will refresh all previous parameter configurations, and the latest passed parameters shall prevail. So every time you modify the configuration, you need to set all parameters, and the parameters that are not set will take the default values.
audio call
Troubleshooting 6:
When using the audio-only call scenario on the web side, after receiving the subscribed remote video stream, no sound can be heard.
prone level: ⭐
Error reason:
After the web side receives the subscribed remote audio, it needs to call the play method to play it.
problem solving ideas:
In the stream-subscribed callback (representing the success of subscribing to the remote audio/video stream), call play to play the remote audio and video stream. At this time, both audio and video recommendations are set to true.
2. Knowledge gas station
Why does fail to open the camera?
There are various reasons for the failure to open the camera, you can refer to the following steps to troubleshoot:
- Make sure the camera permission is turned on. Android, iOS/macOS systems have permission management, please check in the system settings. At the same time, some security software on Android also manages permissions.
- Check to see if another app is occupying the camera. Close other apps, restart your phone and try again.
- Camera hardware problem. Open the video recording program that comes with the system to see if it can record video.
How does deal with video blur?
Video blur is generally caused by the video bit rate or resolution being too low.
- Confirm the resolution setting in the SDK, and you can set the video-related properties through the setLocalVideoConfig method.
- Try a 4G/5G connection, or other WiFi signal to rule out network issues.
- Whether the receiving end accepts a large flow or a small flow, if it is a small flow, you can call the interface to apply for the large flow to close the small flow.
- If there is video pre-processing, please turn off the pre-processing for testing to rule out the problem of pre-processing.
Why does the video freeze?
Video freezes are generally caused by network, device performance, and other reasons.
- Determine whether it is a persistent or a one-time freeze. A one-time freeze is caused by the randomness of the network and devices, which is a normal phenomenon.
- Check the network status to determine whether the connection is normal and whether you can access the Internet.
- If the network connection is normal but still stuck, please try to change the network connection to check if the network connection is still stuck.
- If the network is good and conditions permit, try changing the device.
- If there is video pre-processing, such as beauty, etc., please turn off the pre-processing first, and check whether the freeze is caused by the pre-processing.
3. Technical Supplements
Information | WebRTC M97 Update
Content Overview: WebRTC M97 is currently available in the stable version of Chrome, with over 10 bug fixes, enhancements, and stability/performance improvements.
Content overview: The evolution of templates is a very important line in the development history of C++. The author believes that concept is the biggest feature in this line. This article will explain the concept feature of C++ in detail, in order to have a deeper understanding of C++.
technical dry goods | WebRTC ADM source code process analysis
Content overview: This article is mainly based on the WebRTC release-72 source code and the relevant experience accumulated by the cloud audio and video team. It mainly analyzes the following questions: What is the architecture of ADM (Audio Device Manager)? What is the startup process of ADM (Audio Device Manager)? What is the data flow of ADM (Audio Device Manager)? This article mainly analyzes the relevant core processes, so that when you need it, you can quickly locate the relevant modules.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。