Common Live Transmission Protocols

Live Common Protocols

Common transmission protocols for live streaming include: RTMP, HLS, DASH, and WebRTC.

RTMP (Real-Time Messaging Protocol): RTMP is a protocol for transmitting audio, video, and data between Adobe Flash Player and a server. It uses TCP as the transport layer protocol, which can realize real-time audio and video transmission. RTMP is mainly used to transmit live streams, featuring low latency and high reliability.

HLS (HTTP Live Streaming): HLS is an HTTP-based streaming media transmission protocol developed by Apple. It splits the entire video into small TS (Transport Stream) files and uses HTTP protocol for transmission. The player plays the video by requesting and downloading these small files. HLS supports adaptive bit rate, can automatically adjust video quality according to network conditions, and has good compatibility, and can be played on various devices and platforms.

DASH (Dynamic Adaptive Streaming over HTTP): DASH is an HTTP-based adaptive streaming media transmission protocol developed by the MPEG (Moving Picture Experts Group) organization. Similar to HLS, DASH splits the video into small segments and transmits them over HTTP. The difference is that DASH supports more encoding formats and customization options, as well as multiple bit rate and resolution options to adapt to different network conditions and devices.

WebRTC (Web Real-Time Communication): WebRTC is an open standard for real-time communication, jointly formulated by W3C (World Wide Web Consortium) and IETF (Internet Engineering Task Force). It uses P2P (Peer-to-Peer) technology, allowing browsers to directly establish audio and video communication without going through the server. WebRTC can realize functions such as video conferencing, voice chat and live broadcast through JavaScript API in a web browser, and has the characteristics of low latency and high quality.

Comparison of advantages and disadvantages of each agreement

Advantages of RTMP:

Low latency: RTMP is real-time and suitable for live broadcast applications that require low latency.
High reliability: RTMP uses the TCP protocol and has mechanisms such as data packet retransmission and error checking to ensure reliable data transmission.
Disadvantages of RTMP:

Not applicable to mobile devices: RTMP support on mobile devices is not perfect, and there may be compatibility issues with mobile live broadcast applications.
Requires Flash support: RTMP requires support from Adobe's Flash player, and the use of Flash in modern browsers is limited and may cause compatibility issues.
Advantages of HLS:

Good compatibility: HLS is based on the HTTP protocol and can be played on various devices and platforms, including web browsers, iOS devices and Android devices.
Adaptive bit rate: HLS supports adaptive bit rate, which can automatically adjust video quality according to network conditions to provide a better viewing experience.
Disadvantages of HLS:

High latency: Since HLS divides the video into small files for transmission, each file needs to be requested and downloaded, so there will be a certain delay.
Does not support real-time applications: Due to the characteristics of transmission, HLS is suitable for non-real-time applications and not suitable for live broadcast scenarios that require low latency.
Advantages of DASH:

Adaptive bit rate and resolution: DASH supports multiple bit rate and resolution options, and can automatically adjust video quality according to network and device conditions.
Support more encoding formats: DASH supports more encoding formats, which can adapt to different needs and devices.
Disadvantages of DASH:

Compatibility issues: Since DASH is an open standard, different devices and browsers support it to varying degrees, and there may be compatibility issues.
Requires high server performance: DASH needs to segment and encode videos in real time, which requires high server performance.
Advantages of WebRTC:

Low latency: WebRTC uses P2P technology to directly establish audio and video communication between browsers to achieve low-latency real-time communication.
High quality: WebRTC supports high-definition audio and video transmission, providing a high-quality communication experience.
Good compatibility: WebRTC is widely supported in modern browsers and can be used on various devices and platforms.
Disadvantages of WebRTC:

Not suitable for large-scale live broadcast: WebRTC is suitable for point-to-point communication, not for live broadcast scenarios that require large-scale viewing.
Requires high network bandwidth: WebRTC has high requirements on network bandwidth, and may require a better network environment to achieve high-quality communication.

The following is a detailed comparison table for RTMP, HLS, DASH and WebRTC protocols:

protocol transfer method Delay compatibility Adaptive code rate Applicable scene
RTMP TCP low latency Not suitable for mobile devices no Live applications requiring low latency
HLS HTTP higher latency good compatibility yes Live Streaming on Various Devices and Platforms
DASH HTTP higher latency Compatibility issues yes Live streaming that requires more encoding formats and options
WebRTC P2P low latency good compatibility no Real-time communication and small-scale live broadcast

RTC protocol

The RTC (Real-Time Communication) protocol is a protocol for real-time communication, which is used to realize real-time audio and video transmission and data transmission on the network. The main purpose of the RTC protocol is to allow two or more terminal devices to communicate directly in real time without going through an intermediate server.

The core technology of the RTC protocol is WebRTC (Web Real-Time Communication), which is an open standard based on HTML5, JavaScript and related APIs. WebRTC provides a set of APIs for real-time audio and video communication in web browsers, including media capture, audio and video codec, network transmission, and audio and video processing.

WebRTC works as follows:

Media capture: WebRTC obtains data from audio and video input devices (camera, microphone) through the browser's media device API, such as getUserMedia.
Media processing and codec: WebRTC uses the browser's built-in audio and video codec to process and compress audio and video data to reduce bandwidth and delay.
Network transmission: WebRTC uses UDP or TCP protocol to transmit audio and video data through the network. During the transmission process, WebRTC uses the ICE (Interactive Connectivity Establishment) protocol to establish and manage network connections to achieve NAT traversal and firewall traversal.
Media rendering: The browser at the receiving end decodes and renders the received audio and video data to play the audio and video.
Advantages of WebRTC:

Low latency: WebRTC uses P2P technology to directly establish a communication connection between terminal devices to achieve low-latency real-time communication.
High quality: WebRTC supports high-definition audio and video transmission, providing a high-quality communication experience.
Good compatibility: WebRTC is widely supported in modern browsers and can be used on various devices and platforms.
The application scenarios of WebRTC include video conferencing, voice chat, live broadcast, online games, distance education, etc. It provides developers with an easy-to-use API, making it easier to implement real-time communication in Web applications.

Guess you like

Origin blog.csdn.net/sinat_15735647/article/details/131522303