Choose RTC or RTMP for live broadcast?

 RTC live broadcast

RTC (Real Time Communication) real-time audio and video communication, its biggest feature is low latency and no freeze. In terms of functional process, it includes acquisition, encoding, pre- and post-processing, transmission, decoding, buffering, rendering, and many other links. Each subdivision link has more subdivided technical modules. For example, the pre- and post-processing links include beauty, filters, echo cancellation, noise suppression, etc., acquisition includes microphone arrays, etc., and codecs include VP8, VP9, ​​H.264, H.265, and so on. RTC does not rely on "optimizing" each link to achieve real-time interaction, but relies on the real-time transmission mechanism on the push side.

Many real-time audio and video service providers use the WebRTC standard, which is an open-source browser-based solution for real-time communication. It uses the UDP proprietary protocol for media streaming without creating discrete media segments. The advantage of WebRTC is that the user experience is good, no need to install anything, just share a link and you can watch it. However, this solution requires the host to upload two channels of video: one is P2P to interact with the linker, and the other is to use RTMP to push to CDN. Also download a video: the interactive data sent by LianMai P2P. The bandwidth requirement on the host side is high. In addition, the host needs to perform multi-channel video encoding and decoding, and has higher requirements on the configuration of the host's equipment. However, because the anchor side and the linker are combined into one channel through the CDN, it is impossible to switch the video size window between the anchor side and the linker.

In addition to low-latency streaming, WebRTC provides a real-time bidirectional data channel that can be used to send and receive data streams. This two-way data technology opens up many interesting possibilities for how online streaming can now be an interactive experience. Audiences can vote in real-time during the concert to choose which song they most want the singer to sing. Sports fans can receive customized live sports statistics during games or games. Online shopping channels can display customized offers or pricing for different customers. This possibility seems to profoundly change the experience of live video.

anyRTC real-time live broadcast mode, the terminal equipment of the communication is not on the distribution CDN network, only broadcasts live through the anyRTC RTN network, the delay can be controlled within 200ms, supports a maximum of 50 people to interact with the microphone, and the maximum number of viewers is 100W. During the live broadcast of the channel, the user role can be set to switch between the host and the audience, and the view layout can be arbitrarily placed according to the client scene.

RTMP+CDN live broadcast

RTMP (Real Time Messaging Protocol) is a streaming media transmission protocol based on TCP. The biggest feature is the strong binding with CDN. It needs to use the CDN load balancing system to push the content to the edge nodes close to the user, so that the user can obtain the desired content nearby. , improve the response speed and success rate of user access, and solve the access delay problem caused by distribution, bandwidth, and server performance. Ordinary live broadcasts generally use the TCP protocol and use CDN for content distribution. There will be a delay of several seconds or even ten seconds. The interaction between the anchor and the audience can only be carried out through text messages or gifts. RTMP is more suitable for site acceleration, VOD, short video and other scenarios.

RTMP is a standard protocol based on TCP and is compatible with CDN architecture. For customers, the access cost is relatively low in the existing one-way live broadcast architecture, but the disadvantage is also obvious: when the anchor interacts with the microphone, the sound will interfere. , forming an echo; the broadcaster interacts with the microphone linker, and the transmission delay in the CDN is large; the audience needs to receive two video streams, the bandwidth and traffic consumption are too large, and the decoding and playback of the two video streams consumes CPU and other resources. Much.

 Learning materials collection address: https://docs.qq.com/doc/DQm1VTHBlQmdmTlN2

The current CDN usually has a delay of 3-5 seconds, and the user's perception is not obvious when browsing pictures, short videos and other content. For live broadcasts that do not require real-time strong interaction, such as sports event webcasts, concert webcasts, and news live broadcasts , the delay is acceptable and will not affect the user experience. Online video conferencing, online education, e-commerce live broadcast, telemedicine consultation, and other scenarios that have very high requirements for interaction, the RTMP+CDN model has a certain gap with these scenarios for low latency and no lag. At this time, choosing RTC technology can better meet the needs of developers.

Different from the most common CDN + RTMP live broadcast technology on the market, the live broadcast solution provided by anyRTC uses the unique live broadcast technology and anyRTC SD-RTN, so that the real-time communication quality between the host and the advanced audience (guests) can reach the dedicated line level. In addition, in order to meet today's diverse live broadcast needs, anyRTC also connects with multiple CDNs, supports server-side push-streaming to CDN and client-side push-streaming to CDN, and shares live broadcast content on social platforms.

To build a set of real-time audio and video communication capabilities, in addition to selecting the appropriate technology according to the scene, it also depends on the price and the comprehensive cost-effectiveness of the service. Generally speaking, the cost of using RTC technology is higher than RTMP+CDN. Because, from a practical point of view, UDP transmission consumes more resources than TCP transmission, and retransmission, packetization, FEC redundant calculation, etc. will increase the amount of calculation, and may also encounter excessive memory resources in multi-process mode. consumption, all of which lead to an increase in development and use costs.

The connected microphone solution based on RTMP and CDN technology is very reliable and stable for the product, but the delay is also increasing while being reliable, and using two channels of RTMP to push and pull streams consumes both bandwidth and CPU. The RTC continuous wheat solution has high cost but low latency, which is the trend of future development. In the selection of developers, the price/performance ratio needs to be comprehensively considered in four aspects: technical characteristics, applicable scenarios, price and service. Services play an important role in the development and operation stages before and after product launch.

Guess you like

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