What does push and pull of live audio and video mean?

Why can users quickly see the live broadcast information through mobile phones or websites? Why sometimes the network is unstable and the live broadcast effect is delayed? How is the live video signal transmitted to the network?

All these problems are inseparable from the two words often said in live video: push and pull.

What is push flow?

Push streaming refers to the process of transmitting the packaged content in the acquisition stage to the server. In fact, it is the process of transmitting the live video signal to the network. "Push streaming" has relatively high requirements on the network. If the network is unstable, the live broadcast effect will be poor, and the audience will experience stuttering and other phenomena when watching the live broadcast, and the viewing experience will be very bad.

To be used for streaming, the audio and video data must be encapsulated using a transmission protocol and turned into streaming data. The commonly used streaming protocols are RTSP, RTMP, HLS, etc. The delay of using RTMP transmission is usually 1-3 seconds. For the real-time requirement of mobile live broadcast, RTMP has also become the most commonly used streaming transmission in mobile live broadcast. protocol. Finally, the audio and video stream data is pushed to the network through a certain QoS algorithm, and distributed through the CDN.

In live broadcast scenarios, network instability is very common. At this time, QoS is required to ensure the user experience of watching live broadcasts under unstable network conditions. Usually, caches are set on the host and playback sides to make the bit rate uniform. In addition, dynamic bit rate and frame rate are also the most commonly used strategies for real-time changing network conditions.

The widely used "push streaming protocol" in live broadcast is generally RTMP (Real Time Messaging Protocol-Real Time Messaging Protocol). This protocol is a TCP-based protocol family and a network protocol designed for real-time data communication. It is mainly used for audio, video and data communication between the Flash/AIR platform and the streaming media/interactive server supporting the RTMP protocol. . Software that supports this protocol includes Adobe Media Server/Ultrant Media Server/red5, etc.

What is pull flow?

Streaming refers to the process of establishing a connection with the server, receiving data, and pulling according to the protocol type (such as RTMP, RTP, RTSP, HTTP, etc.) that the server already has live content. The core processing of the streaming end is decoding and rendering on the player end, and functions such as chat rooms, likes and gift systems need to be integrated in the interactive live broadcast.

The streaming end now supports three protocols: RTMP, HLS, and HDL (HTTP-FLV). Among them, when the network is stable, the delay control for the HDL protocol can reach 1s, which fully meets the business needs of interactive live broadcast. RTMP is Adobe's patented protocol, which is well supported by open source software and open source libraries, and the delay is generally 1-3 seconds. HLS is an HTTP-based streaming media transmission protocol proposed by Apple. The priority is to have better cross-platform performance. HTML5 can be directly opened and played, and the mobile terminal has good compatibility, but the disadvantage is that the delay is relatively high.

What is the difference between push and pull?

The user finally sees a live video, which may be achieved in two ways. One is to actively transmit the content to the server and cache it on the edge node. The end user can call and watch it at any time. This is push streaming; When you want to watch a certain content, the content is retrieved from the origin site and cached to the edge node, which is pull streaming.

Take a simple example:

As a courier company, there are courier companies in various communities, so I provide two services:

Catch flow service: that is, door-to-door pickup

Streaming service: You choose to send the item to the courier company in the community because you are afraid that the courier will have unreasonable ideas.

Guess you like

Origin blog.csdn.net/m0_60259116/article/details/123433401