How can live audio quality be improved

1, at the time of using anyRTC SDK for live, the SDK default is open the AEC (echo cancellation) function, the function of sound quality has a certain loss, so before the premiere suggest close the function first, when live with others to establish the wheat in open the function, avoiding the phenomenon of interaction when produce echo, when the end, You can continue to disable this feature.

PEngine ->setParameters("{\"Cmd\":\"SetExternAec\", \"Enable\": true}");Copy the code

2. Before broadcast, set the audio properties. The default sampling rate is 32 KHz, mono, and the maximum coding rate is 18 Kbps. AnyRTC supports sampling from 8kHz (narrow band) to 48kHz (full band), and the highest coding rate is 196K. If the setting is too large, the effect may not be good. In order to find a suitable scene, the sampling rate of 48 KHz is generally used in the live broadcast scene, with dual sound channels and the coding rate set at 56 Kbps. The effect of voice and music can be optimized and the efficiency is the highest. The 64Kbps bit rate is ultra broadband, which is sufficient for both voice calls and live music.

3. It is recommended to enable the AI noise reduction function for outdoor live broadcast scenes. This feature innovatively uses deep learning technology to separate voice and background noise in real time and clearly extract human voice, effectively eliminating all kinds of noise in the environment, so that users can enjoy a clearer and more efficient online audio and video call experience.

PEngine ->setParameters("{\"Cmd\":\"SetAudioAiNoise\", \"Enable ": 1}"); pEngine->setParameters("{\"Cmd\":\"SetAudioAiNoise\", \"Enable ": 1}");Copy the code

Skin care plan

Directly integrate the third-party beauty SDK, use the camera function provided by the third party beauty company, and realize beauty + sticker function with anyRTC self-collection function.

Push the flow scheme

If you purchase CDN services from major cloud vendors, you can choose them according to your own volume and product operation area. If the product is overseas, it is recommended to use the network. If the product is domestic, there is no big difference in THE CDN service of major manufacturers.

Anchor bypass push flow how to choose a plan

AnyRTC first launched the function of client 4 connecting with the mic in 2016, which has been highly praised by customers. With the continuous running-in with customers, anyRTC launched the client push-stream CDN component and ** server push-stream CDN **. The two methods are combined to create a seamless bypass live broadcasting scheme.

AnyRTC adheres to the principle of simple function, consistent callback and seamless switching to design bypass stream components, whether it is client-side push stream CDN component or server-side push stream CDN component.

  • Start pushing stream: Support pushing multiple addresses
  • Push over flow
  • Live streaming mode: audio streaming, video streaming audio streaming, video streaming
  • Combined layout: custom layout, according to the business scenario layout: large and small screen,PK screen, etc
  • Confluence background: Customize the background of the push stream
  • Watermarking: Adds a watermarking operation to a merged view
  • SEI: Supports the insertion of media attachment information into video frames to ensure strict synchronization between video frames and media attachment information
The client pushes the CDN component

AnyRTC developed this component is to reduce the burden for the enterprise, we all know that the price of bypass stream on the market is very expensive, entrepreneurs themselves are in the lack of cash, but want to add their own live broadcast room interactive link bypass play, customer side push stream CDN component shoulder the task of the enterprise.

Implementation process:

1. The host starts live broadcasting and starts local streaming

2. The audience enters the live broadcast room and enters the real-time stream of the RTC anchor as a tourist

3. Viewers apply for linmic to change their roles to the main cast. After receiving the stream from the audience, the host side calls the “setLiveTranscoding” method of the local stream push component to carry out mixed stream layout

4. If the audience hangs up and changes the role to a tourist, the anchor receives the callback from the audience and calls the “setLiveTranscoding” method of the local push stream component to change the layout

5.H5 terminal can access video stream in M3U8 format to watch live broadcast

Advantage:

  • Save money: You don’t have to pay for the bypass stream
  • Small delay: the anchor side directly pushes the stream, reducing the delay loss in the transmission process

disadvantage

  • Hot mobile phone: mobile phone directly push flow, some loss of mobile phone performance
  • In the weak network environment, the effect of live broadcasting is affected. The host end sends two streams to test the uplink network of the host end.
The server pushes the stream CDN

In the process of using the client to push the stream CDN component, some clients want to use the Web terminal to do bypass broadcast. Or the user’s terminal mobile phone type is mixed, some low-end mobile phones can not directly use the client push stream CDN component; Some users have extremely bad network environment and use the client to push stream CDN components to affect the effect of live broadcast. Based on the demands of the above customers, anyRTC provides a second bypass solution: server push stream CDN.

The server pushes the stream CDN, and the anchor invokes the interface, allowing the server to complete the function of merging and pushing the CDN, without any impact on the local.

Implementation process:

1. The host starts live broadcasting and enables the bypass stream on the server

2. The audience enters the live broadcast room and enters the real-time stream of the RTC anchor as a tourist

3. Viewers apply for linmic to change their roles to the main cast. After receiving the stream from the audience, the host invokes the “setLiveTranscoding” method of the server interface for mixed-stream layout

4. If the audience hangs up and changes the role to a tourist, the anchor receives the callback from the audience and calls the “setLiveTranscoding” method of the server interface to change the layout

5.H5 terminal can access video stream in M3U8 format to watch live broadcast

  • Advantage:

    • Mobile phones with poor performance can also be used as the anchor side for bypass broadcast
    • When the client network condition is not good, the impact on live broadcast is small
    • Live broadcast can also be performed on the Web

    disadvantage

    • Increased customer costs

    • Large delay: The audio and video streams are transferred through the server and then synthesized and transcoded in the bypass streaming service.

Best practices

1. Use the streaming CDN function of the server when hosting the Web

2. If the user terminal is an anchor of a low-end device, use the streaming CDN function on the server; otherwise, use the streaming plug-in on the client

3. The client uses RTC to detect the network condition in real time. If the network condition persists, turn off the local bypass stream pushing component and invoke the CDN interface of the server to push the stream for seamless replacement

4. In voice connection scenarios, you are advised to bypass the client

5. In a two-person PK live broadcast scenario, bypass the CDN component on the client and

Other problems

How to connect the mic with anchor in the room?

Application process:

1. Use THE RTM SDK to send point-to-point messages and send the mic connection request to anchors. If the mic list needs to be displayed, the mic connection event needs to be reported to its own service

2. The host agrees to the request

Communication process:

1. The visitor enables the local camera and invokes the RTC interface to switch roles

2. The anchor receives the callback of the tourist becoming the anchor and changes the layout locally according to the current mode

Anchor PK even mai how to achieve?

Call anyRTC cross-room link interface for PK link.

Implementation process:

1. Anchor A obtains the list of live anchors through the service interface

2. Select host B and send the PK invitation link

3. Anchor B agrees to connect mic to PK, anchor A and ANCHOR B, and call cross-room mic interface. Anchor A sends anchor B’s flow to room A, and Anchor B sends anchor A’s flow to room B for real-time interaction

4. Fans in each host’s room call and cheer on their hosts

How do X(movies, ball games) work together?

Call anyRTC insert media stream function to implement.

Implementation process:

1. The anchor inserts a media stream into the room through the interface, and the media stream enters the live broadcast room as a user

2. Other audiences receive and subscribe to this media stream, with an average delay of about 200ms, so as to achieve the effect of watching together

How to implement chat interactive message?

Call anyRTC RTM channel message function to achieve.

Implementation process:

1. Anchors and tourists join the RTM channel at the same time when they join the live room

2. When a user enters the room, the user will send a message of entering the room after successfully joining the channel

3. Chat and gift messages can be implemented through custom channel messages

Video seconds on how to optimize?

1. Ensure network speed: The quality of network speed is a direct factor of video seconds

2. Preloading: When the video is about to leave, preloading the next live video source can effectively solve the speed of the first pin out

3. Optimize the keyword policy and minimize the keyword duration

4. Player thread optimization: Separate the pull thread from the decoder thread

.

conclusion

There are also some business logic such as sequence function, refuelling group, permission setting, version compatibility, video layout and so on, which need to be strengthened by the product manager.

AnyRTC live even Mai Demo has been online, there is a need to contact customer service to obtain source code. This demo shows 3 kinds of live link, real-time interactive link, client side push stream CDN form and server side push stream CDN form, have the need of friends, contact us ~