Decoding Baidu's live streaming slicing method

Publisher:平和的心态Latest update time:2020-06-28 Source: 爱集微Keywords:slice Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

At 8 pm on May 15, Robin Li appeared in Baidu's live broadcast room and had a conversation with Fan Deng, the founder of Fan Deng Reading, on the theme of "Home·Books". It is worth noting that Baidu Live focuses on the field of information and knowledge, avoiding direct "bayonet fighting" with Douyin and Kuaishou, and Robin Li's personal participation also demonstrated Baidu's determination to focus on the live broadcast business.

In 2012, YY Live took the lead in launching a plug-in to support e-sports live streaming. In the following years, a large number of live streaming platforms emerged like mushrooms after a rain, such as Douyu TV, Huya Live, Zhanqi Live, etc. With a large amount of capital pouring in led by BAT, "live streaming" has become the darling of the Internet capital circle.

Among the computer technologies involved in live broadcast, HLS (Hypertext Live Streaming) is definitely one of them. This protocol is a streaming media transmission protocol based on HTTP (Hypertext Transfer Protocol). It is widely used in the field of Internet video live broadcast and is one of the current mainstream Internet live broadcast protocols.

Compared with other common Internet live broadcast protocols, the biggest difference of HLS protocol is that HLS protocol slices the live stream into continuous, short-duration TS files on the server, and the live broadcast viewers continuously download and play these TS files. Because the server always generates new TS files for the latest live stream, the live broadcast viewers only need to continuously play the TS files obtained from the server in sequence to achieve live broadcast.

On January 24, 2019, Baidu applied for an invention patent called "Live stream slicing method, device and system" (application number: 201910068514.3), and the applicant was Beijing Baidu Netcom Technology Co., Ltd.

Based on the currently disclosed patent information, let us take a look at this live broadcast method.

As shown in the figure above, the system architecture designed in the patent can include a live broadcast source server 101, an HLS source server 102, an object storage server 103, and networks 104 and 105. Network 104 is used to provide a medium for a communication link between the live broadcast source server and the HLS source server. Network 105 is used to provide a medium for a communication link between the HLS source server and the object storage server 103.

The HLS source server can interact with the live source server through network 104, and can also interact with the object storage server through network 105 to receive or send messages.

The live source server can be used to store the live stream, and the object storage server can be used to store the index file and fragment file of the live stream. The HLS source server can be used to obtain the live stream from the live source server, slice the live stream, generate the index file and fragment file of the live stream, and send the index file and fragment file of the live stream to the object storage server so that the object storage server can store the index file and fragment file of the live stream.

The figure above is a flowchart of the live stream slicing method. First, the live stream is obtained from the live source server. The HLS source server can obtain the live stream from the live source server. The live stream is the live video recorded by the live user using his terminal device.

Secondly, the live stream is sliced ​​to generate the index file and fragment file of the live stream. The HLS source server slices the live stream to generate the index file and fragment file of the live stream. Among them, the index file is an M3U8 file, and the fragment file is a TS file. Usually, the TS file can be found according to the index recorded in the M3U8 file, and the found TS files can be played in sequence continuously to achieve the playback of the live stream.

Finally, the index file and fragment file of the live stream are sent to the object storage server. The HLS source server sends the index file and fragment file of the live stream to the object storage server, so that the object storage server stores the index file and fragment file of the live stream.

The object storage server is a BOS server. When a live broadcast user initiates a live broadcast request, the HLS source server searches the object storage server for the index file and segment file of the requested live stream and returns them to the terminal device of the live broadcast user. The terminal device of the live broadcast user plays the segment file of the live stream based on the index file of the live stream to achieve live broadcast.

Next, let's understand this live stream slicing system through an application scenario.

As shown in the figure above, the terminal device of the user watching the live broadcast sends a live broadcast domain name resolution request to the CDN scheduling server. The CDN scheduling server resolves the live broadcast domain name in the live broadcast domain name resolution request into the VIP of the CDN edge node and returns it to the terminal device of the user watching the live broadcast.

Subsequently, the terminal device of the live broadcast user sends a live broadcast request to the load balancing server of the CDN edge node based on VIP, and the load balancing server sends a live broadcast request to the HLS source server. If the object storage server does not store the index file of the requested live stream, the HLS source server obtains the requested live stream from the live source server, slices the requested live stream, generates the index file and fragment file of the requested live stream, and sends them to the object storage server and the load balancing server.

Finally, the object storage server stores the index file and the shard file. At the same time, the load balancing server sends the index file and the shard file to the terminal device of the live broadcast viewing user. The terminal device of the live broadcast viewing user plays the shard file based on the index file to play the live broadcast stream for the live broadcast viewing user to watch.

The above is the invention patent invented by Baidu to reduce the live broadcast delay. When the terminal device of the live broadcast viewing user initiates a live broadcast request, the HLS source server obtains the live stream from the live broadcast source server for slicing, generates the M3U8 file and TS file of the requested live stream, obtains the M3U8 file and TS file of the requested live stream from the object storage server, and returns it to the terminal device of the live broadcast viewing user. This method will help reduce the live broadcast delay and greatly improve the availability of the live broadcast service!


Keywords:slice Reference address:Decoding Baidu's live streaming slicing method

Previous article:Germany's decision on Huawei 5G equipment may be delayed until September
Next article:In addition to Apple! Samsung is also "targeted" by this company

Latest Mobile phone portable Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号