From the perspective of how the live source to solve the problem of packet loss

Network online broadcast system, the general process is: Acquisition → pretreatment → coding → Streaming → distribution → pull flow → decoding → play, each stage will occupy part of the time, so that the timeliness of these processes in order to protect users view all It requires a high degree of unity with, so as to reduce delays and live online.

Let's say for what reason is cause broadcast delay.

First, the network fluctuations

We are talking here of the network means that fluctuations in the sorted data package, a package is any delay, it will not cause it to arrive in the correct order to reach the end user, and naturally can not accept the order in accordance with the contents play out, showing on the receiving user's screen. Internet fluctuation would lead content played live network delay and Caton, but this reason can only be counted as external factors delayed broadcast, it had little to do with their own live online source.

Second, network packet loss

Live online streaming source protocol used are: RTMP, HLS, HTTP FLV other, the transmission process is generally: terminal sends a connection request anchor → → anchor end server agree that the wiring to the server.

After three processes mentioned above, the anchor end will continue to send data in batches, each batch of sending the data needed to be fed back to the server the next step, if the received feedback is the emergence of the phenomenon of network packet loss the system will automatically transfer the missing packet, which is automatic retransmission packet loss, so the middle of the interval will cause a delay live.

For two reasons above mentioned small series, how do we live system to solve the problem of delay it? As the network fluctuations are external factors that broadcast from the source point of view, we can on this issue from the network to optimize packet loss.

Xiao Bian recommended three optimization methods, we can learn from the development process live online source:

1, using the transfer protocol RTMP

RTMP live streaming protocol as the transport protocol of choice because of its relatively low latency, usually reduces within 5s, the next it can be general support for third-party content delivery network, with packet loss reconnection mechanism, timely guarantee fluency live online.

2, the use of content delivery network

The individual live content delivery network edge server content cache, issued content nearby, can effectively reduce delay broadcast, live content increased speed.

3, select the appropriate codec

Codec principle is the size of the compressed data packet, during transmission to reduce the occupancy of the video for broadband, to reduce delay. Select the appropriate codec is certainly able to solve the problem of a large part of the delay.

Live delay problem caused by the network packet loss, when performing live source development is relatively easy to solve, with the choice to build a CDN on the line.

Guess you like

Origin blog.51cto.com/14318279/2409092