Differences and meanings of RTMP, RTSP, m3u8, flv

RTMP and RTSP are two common streaming media protocols.
A streaming protocol is a protocol for delivering multimedia over the Web.
Every time you watch live or on-demand video, the technology behind it is the streaming protocol.

RTMP
English full name: Real Time Messaging Protocol
Chinese meaning: real-time message protocol
underlying protocol: TCP
application-level video streaming protocol
video codec: H.264
audio codec: AAC
delay: 3 - 30 seconds

The biggest advantage of RTMP is that it can maintain a stable connection between the server and the client server,
regardless of the quality of the user's Internet connection, it can seamlessly transmit streaming media with low latency.
This technology works by dividing the data stream into equal parts and transmitting them sequentially to the receiving device, then recombining them into a video stream.

The biggest disadvantage of RTMP is that it is not compatible with HTML5 players, so another protocol, such as HLS, must be used to transmit video files to the user's device. In addition, RTMP is susceptible to bandwidth issues.

RTSP
English full name: Real Time Streaming Protocol
Chinese meaning: real-time streaming protocol
underlying protocol: TCP and UDP
network control protocol
video codec: H.265
audio codec: AAC
delay: 2 seconds

RTSP supports reliable segmented streaming, which means that users can continue watching the stream while it is still downloading. Android and iOS devices do not have RTSP-compatible players out of the box, so popularity is not high, but RTSP is widely used in many surveillance and closed-circuit television (CCTV) applications, such as remote cameras, online education, and Internet live broadcasts
.

The difference between RTMP and RTSP

  1. Delay
    RTMP: 3-30 seconds
    RTSP: 2-5 seconds
  2. Pros
    RTMP: Low latency Adaptive flexibility No buffering required
    RTSP: Low latency segmented streaming
  3. Disadvantages
    RTMP: Bandwidth issues HTML5 does not support compatibility issues with some browsers and devices Security is a bit low
    RTSP: HTTP is not compatible Depends on other protocols

How to choose between RTMP and RTSP?
For IP cameras and IoT devices, you can’t go wrong with RTSP.
For third-party streaming media applications, you can’t go wrong with RTMP.


m3u8 is precisely an index file.

Using the m3u8 file actually resolves the corresponding video network address on the server through it, so as to realize online playback.

The use of m3u8 format files is mainly because it can realize multi-bit-rate video adaptation. Video websites can automatically match a suitable bit-rate file for the client to play according to the user's network bandwidth, thereby ensuring the smoothness of the video.

The current video websites use the streaming media transmission protocol, which is to cut a video into countless small segments. These small segments are video files in ts format, which are played on the website segment by segment.

The advantage of this is that the viewing is smoother, because it will automatically switch the definition of the video according to the network conditions, which is very helpful to ensure smooth playback when the network conditions are unstable.

If you directly load mp4 or flv files, when the file is very large, such as an episode of 2 hours, 1080p may have a size of 2G, direct loading will be very slow, if you slice it, you only need to load m3u8 files, and play according to the index in m3u8, this loading will be very fast.


flv is a streaming file.
flv files can be analyzed while being transmitted.
flv files can be downloaded and watched at the same time.
The flv format does not need to be downloaded completely, and it supports analysis and viewing


Reference https://zhuanlan.zhihu.com/p/519452302

Guess you like

Origin blog.csdn.net/weixin_42436236/article/details/128465296