How to build a set of video streaming media server platform through privatization deployment How to solve the video playback delay problem (2) Different video streaming delay instructions

In view of the video delay problem of the privatized deployment of a set of streaming media server software, we introduced the network situation, the code stream of the front-end equipment, the number of the front-end equipment, and the live streaming protocol of the main factors affecting the low video delay. Choose four elements, this article mainly introduces the last one, the choice of live streaming protocol.

With so many user needs every year, we find that with regard to live video broadcasting, delay is a particular concern for users. Based on the needs of these users, we have previously published a blog post about delay testing: How EasyNVR performs delay testing .

Different network sites will have different delays, but apart from the influence of this external factor, different live streams will have their own delays. This delay is irreversible. This article will introduce you to each:

RTMP

Advantage:

RTMP's optimization of the bottom layer is better than other protocols. At the same time, it supports Adobe Flash well. Basically all encoders (cameras and the like) support RTMP output. In addition, RTMP is suitable for long-term playback, and it has been tested for 1 million seconds, that is, continuous playback for more than 10 days without problems. Finally, the delay of RTMP is relatively low, generally between 1-3s, and general video conferences and interactive live broadcasts are completely sufficient.

Disadvantages:

Of course, RTMP is not perfect, and it has its shortcomings. On the one hand, it is based on TCP transmission. Non-public ports may be blocked by firewalls. On the other hand, it is also a pitfall. On the other hand, RTMP is a proprietary protocol of Adobe, which cannot be played by many devices, especially on the iOS side. Only third party decoders can be played.

30.png

HLS

Advantage:

HLS is an HTTP-based streaming media network transmission protocol proposed by Apple. It is part of Apple's QuickTime X and iPhone software systems. It works by dividing the entire stream into small TS-based files for downloading, and downloading only a part of it each time. When the media stream is playing, the client can choose to download the same resource at different rates from many different alternate sources, allowing the streaming media session to adapt to different data rates. High performance, can be distributed through the CDN network.

Disadvantages:

The disadvantages of HLS are also very obvious. First of all, HLS has poor real-time performance and high delay. The delay of HLS is basically above 10s+. In addition, because HLS does not request a complete data stream, it generates many file fragments. The small ts slice will cause a large number of small files, which poses certain challenges to storage and caching.

31.png

FLV

Advantage:

FLV is a storage container format for streaming media data transmitted on the network. What we call HTTP-FLV is to encapsulate streaming media data into FLV format, and then transmit it to the client through the HTTP protocol. HTTP-FLV can penetrate firewalls well. It is based on HTTP/80 transmission, effectively avoiding being intercepted by firewalls. In addition, it can jump to flexible scheduling/load balancing via HTTP 302, supports encrypted transmission using HTTPS, and is compatible with mobile terminals that support Android and iOS.

Disadvantages:

FLV also has a shortcoming. Due to its transmission characteristics, streaming media resources are cached in the local client, which is not good enough in terms of confidentiality.

32.png

RTSP

Advantage:

RTSP is on top of RTP and RTCP in architecture, and it uses TCP or UDP to complete data transmission. When using RTSP, both the client and the server can make requests, that is, RTSP can be bidirectional. RTSP is a multimedia streaming protocol used to control audio or video, and allows multiple streaming requirements to be controlled at the same time. The network communication protocol used during transmission is not within its defined range. The server can choose to use TCP or UDP to transmit. For streaming content, its syntax and operation are similar to HTTP 1.1, but time synchronization is not particularly emphasized, so it can tolerate network delays. Because the operation mode is similar to HTTP1.1, the cache function of the proxy server <Proxy> is also applicable to RTSP, and because RTSP has a redirection function, the server that provides the service can be changed according to the actual load situation. Avoid excessive load concentrated on the same server and cause delay.

Disadvantages: RTSP live streaming protocol generally uses udp as the transport layer, which is suitable for IPTV scenarios.

Compare

  • In terms of transmission protocol: RTMP→TCP, HTTP-FLV→HTTP, HLS→HTTP, RTSP→UDP;
  • Video packaging format: RTMP→FLV/TAG, HTTP-FLV→FLV, HLS→M3U8/TS, RTSP→TS/MP4;
  • Delay: RTMP→2S, HTTP-FLV→2S, HLS→10S+, RTSP→3S;
  • Data segmentation: RTMP→continuous stream, HTTP-FLV→continuous stream, HLS→slice, RTSP→slice.

to sum up

TSINGSEE Qingxi Video uses intelligent scheduling, link guarantee, frame tracking processing, frame loss processing and the industry’s first HLS+ technology to control the RTMP live broadcast delay within 1 second, and delay HTTP-FLV, WS-FLV, RTSP live streaming Control within 3 seconds, and control the HLS live broadcast delay to about 10 seconds.

NVR9.png

Therefore, when the network, code stream, and equipment performance are excluded, in different live broadcast scenarios, choosing a suitable live broadcast protocol can greatly reduce the delay of live broadcast. Of course, in the process of privatization deployment, the above points need to be considered comprehensively to ensure the smooth playback of video streams.

Guess you like

Origin blog.csdn.net/TsingSee/article/details/108779100