Live streaming weak network optimization strategy | live streaming SDK performance optimization practices, sdk Performance Optimization

Source: Internet
Author: User
Tags connection reset

Live streaming weak network optimization strategy | live streaming SDK performance optimization practices, sdk Performance Optimization
Scenarios of weak Network Optimization

After more than a year of rapid development, the online live broadcasting industry has developed a variety of methods. The earliest webcast was when the anchor sat in front of the PC and installed professional live video devices (such as cameras and microphones) before they could start broadcasting. Later, with the improvement of mobile phone performance and the improvement of live video technology, the broadcaster only needs a mobile phone and a network to broadcast live. Since the development of live broadcasting, a single indoor chat interactive live broadcasting cannot meet the needs of the audience. The broadcasters started to live in more scenarios.
In the foreseeable future, this form of live broadcasting will develop rapidly. The live content will be superior, and the live content will also change from pure entertainment to experience.
To extend live broadcasting to the outdoors, You need to overcome many difficulties. The main difficulty is to cope with unstable networks. In a mobile network, it is usually prone to network instability, Connection Reset, and reconnection due to disconnection. On the one hand, frequent reconnection requires overhead to establish a connection. On the other hand, especially when the GPRS/2G/3G/4G switch occurs, the bandwidth may have a bottleneck. When the bandwidth is not enough, the content with a higher frame rate or a higher bit rate is difficult to send out, we need to execute different policy encoding to push the stream in different network conditions, this allows the audience to see the best live video.

Principle of weak Network Optimization

Thought 1:

Adjust the bit rate, FPS, and resolution based on the uplink bandwidth.
There is actually a conceptual concept for network optimization. How can we evaluate a stream pushing solution? Is it a good solution for network optimization? First, we need to know three concepts: BitRate, FPS, and VideoSize, which are related to decoder ).
People's feelings about video streams are concentrated in choppy, fuzzy, and other negative situations. These situations often occur in UGC and PGC live broadcast scenarios. Live streaming requires high real-time performance. To ensure real-time performance, you must make a choice when the network bandwidth is insufficient or the uplink speed is poor. Either choose a better smoothness but a lower definition (Fuzzy), or choose a better definition but a lower smoothness (choppy ). After a resolution is selected, the resolution will not be changed during the streaming process, but the bit rate and FPS can be adjusted to achieve the above two conditions.

Through this association, we can easily know how to make adjustments at the technical level. We can appropriately reduce the bit rate in pursuit of better smoothness. If the FPS is already high (for example, 30), the FPS can be maintained without changing. If the FPS is unacceptable due to the low bit rate, you can lower the FPS accordingly. In the pursuit of clearer painting quality, the bit rate can be improved. The FPS is adjusted to around 24, and most human eyes are still recognized as smooth. If you can accept a slight lag, you can set a lower FPS, such as 20 or even 15.
In short, the three are both clear pictures and smooth videos, but the final parameters must be constantly adjusted and optimized to meet the needs at the product level.

Thought 2:

High compression ratio encoding technology, such as H.265
Of course, dynamic adjustment of the encoding policy is a way to deal with the problem, while directly increasing the compression ratio of video streams to reduce the requirements of live streaming on the network is also a method. Currently, H.265 encoding can reduce the bandwidth usage by 40%. However, there are still many problems to solve when H.265 encoding is used for live streaming on mobile phones. For example, H.265 encoding has a high performance overhead for mobile terminals, which may cause problems such as high fever and excessive power loss.

What does qiniu do with weak network optimization?

Obviously, weak network optimization is a very useful function in the current diversified live broadcasting industry. Therefore, qiniu live broadcasting cloud SDK has made a lot of efforts in this regard, the following describes the ideas and effects.
Customizes outstanding weak network optimization strategies based on feedback from a large number of customers
The essence of the so-called weak network optimization is a strategy. The effect of weak network optimization depends on the following two points:

1) more accurate and fine-grained detection of network conditions to facilitate parameter adjustment by the streaming SDK.

2) richer policies and more reasonable choices. When the SDK accurately reflects the network situation, we need to make a correct judgment and select an appropriate policy to deal with it.
To achieve the above two points, a large amount of user feedback is required to verify the reliability and effectiveness of the policy. Qiniu live streaming cloud has been verified by many customers and does not require any configuration when integrating the qiniu live streaming SDK. This function is enabled by default.

Excellent optimization results

Weak network optimization Report-iOS
Purpose: To test the live broadcast performance of qiniu and a famous live broadcast App on a weak network.
Test scope: qiniu iOS streaming demo and a famous live broadcast App
Test Strategy: Use the atc weak network tool to simulate a network with a packet loss rate of 10%, and use the qiniu demo and a famous live broadcast App for 5 minutes at the same time, use SrsPlayer for playback (the player parameters are the same) to view the playback effect and count the number of choppy times.
Test results: If the packet loss rate is 10%, qiniu iOS performs better than iOS of a famous Live App.

Weak network optimization Report-Android
Purpose: To test the performance of qiniu and the famous live broadcast App on the Android client in the weak network.
Test scope: qiniu Android streaming demo and Android end of a famous live broadcast App
Test policy: simulate a weak network from the perspective of limiting upstream/downstream traffic and setting packet loss rates. For detailed settings of the weak network environment, see the following content.
The atc weak network tool is used to simulate a 3G network and a network with a packet loss rate of 10% respectively. The qiniu Android streaming demo, the Android end of a famous Live App, and the live video clock are used for 5 minutes, use SrsPlayer to view the playback effect and count the number of choppy times.
Test results:

When the packet loss rate of 3G is 0, qiniu Android is superior to the Android end of a famous live video App.

With a packet loss rate of 10%, qiniu Android performs slightly better than Android of a famous live video App.

Test data:

3G network:


1) 3G packet loss rate 0 (uplink 420 Kbps, downlink 850 Kbps ):


2) Good network packet loss rate of 10%:


Weak network optimization is a very worthwhile feature in the live broadcasting field. Although the network quality has been being upgraded, the audience's requirements are also increasing. It is an art to dynamically adjust the stream of the best viewing experience according to the network conditions.

We can also look forward to the future. For example, we have made a dynamically adjusted policy into a cloud-based library. Each worker will report the results of the use of the weak network optimization strategy. These massive results data can be modeled using machine learning to create better policies, and finally these policies are fed back to various terminals.

Live broadcasting is undoubtedly a hot topic in 2016. After qiniu cloud released its real-time stream network LiveNet and live video cloud solutions at the end of June, we systematically introduced the key technologies in all aspects of the live video by using the series of articles in "live video technology details" to help live video entrepreneurs gain a more comprehensive and in-depth understanding of live video technology and better technology selection.

The live video SDK performance optimization Practices series introduces the technical innovation practices of qiniu cloud on the live video SDK. Welcome to explore.

Author :@Qiniu cloud pili Technical Team

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.