Analysis of real-time streaming media of RTMP data transmission protocol developed by instant messaging

In recent years, with the improvement of network bandwidth and the development of multimedia compression coding technology, streaming media technology has been widely used. The global streaming media market is developing at a very high speed, and has gradually replaced the traditional Internet based on text and pictures. According to Cisco's Visual Networking Index (VNI) statistics, streaming media traffic accounted for only 5% of the total global Internet traffic in 2005, but this proportion has increased to 40% by 2011, and it is expected that this proportion will further increase to 62% by 2015. %. At the same time, streaming media technology has also broken through the limitations of computers and entered the fields of tablets and smart phones. An era of Video Every Where is coming.

 

In this environment of rapid development of streaming media, TV stations and video service providers in various places have started their own streaming media business one after another. When building a business platform, how to choose a streaming media platform that suits you has become a crucial issue. China Internet TV, China Education TV, Henan TV, Shenzhen TV and other TV stations, as well as Liujianfang, Qiqi.com, Weishi.com and other streaming media service providers have chosen Adobe's streaming media system based on the Flash platform. The RTMP protocol [2] used by the system to transmit data has therefore been widely used. This article will analyze its characteristics in detail, and build a live streaming system based on RTMP protocol.

Streaming media services in the current Internet can be roughly divided into two modes in terms of transmission modes: sequential streaming transmission and real-time streaming transmission.

Sequential streaming uses a common HTTP server as a server for storing multimedia files. When the client initiates a connection and wants to watch multimedia resources, it directly downloads the file to the temporary folder of the client's local system through the HTTP protocol, and then uses the player to play the downloaded file. Its process of interacting with the server is shown in the figure below.

The essence of sequential streaming is to play local files. Sequential streaming is currently widely used: YouTube, Youku, Tudou and other video service providers have adopted this method to provide multimedia services. The advantage of sequential streaming is mainly to reduce the pressure on the server, that is, when the multimedia file is downloaded, the connection can be disconnected, thereby saving server resources and serving other clients. In addition, ordinary HTTP servers are used for sequential streaming, and video service providers do not need to spend extra money to purchase streaming media servers, thereby saving a lot of money. Instant messaging chat software app development can add Wei Keyun's v: weikeyun24 consultation

 

Live streaming uses dedicated streaming servers to store multimedia files. When the client initiates a connection and wants to watch multimedia resources, usually the multimedia data located on the streaming media server is directly transmitted to the client player through a proprietary real-time streaming protocol, and then played in real time. The process of his interaction with the server is shown in the figure below.

The application of real-time streaming transmission is still in the development stage, and it is mainly used in online live broadcasting and on-demand broadcasting of genuine movies and TV shows. When using real-time streaming to watch multimedia resources, since the files will not be downloaded locally, it can prevent the content of the video and audio provider from being illegally copied, thereby protecting the copyright of the video and audio content. In addition, when using real-time streaming to watch multimedia resources, you can jump to any position of the video and audio at will, instead of only watching the downloaded part like sequential streaming, thus greatly increasing the viewing time. degrees of freedom.
 

RTSP is proposed by IETF (Internet Engineering Task Force) [3]. The full name of the RTSP protocol is Real Time Streaming Protocol, that is, the real-time streaming protocol, which is the RFC standard of the IETF.

RTSP is used to control the transmission of streaming media, such as establishing a connection, playing, pausing, etc., but it does not transmit multimedia data itself. Multimedia data is usually transmitted using the RTP/RTCP protocol. The full name of the RTP/ RTCP protocol is Real - time Transport Protocol / Real - time Transport Control Protocol, that is, Real-time Transport Protocol / Real-time Transport Control Protocol, which is also the RFC standard of IETF, and is specially used to transmit multimedia data.

Although RTSP + RTP is a combination of international standards, it has not been able to "unify the world" in the Internet world. This has a lot to do with the environment of the Internet.

RTP/ RTCP is the network protocol for transmitting multimedia data, and UDP protocol is generally used as the network protocol of its transport layer [3]. UDP is connectionless and does not provide reliable delivery, so problems such as packet loss, delay, and jitter are prone to occur when transmitting data on the Internet (especially the WAN). Multimedia data has high requirements on packet loss, delay, and jitter, and a little problem will greatly affect the user's quality of experience (QoE) [4]. Therefore, there are not many streaming media transmitted in RTSP + RTP mode on the Internet.

However, there are exceptions. Now the real-time audio and video chat in the mainstream instant messaging (ie IM chat application), this component is often used. Important, when the network is bad, the video can be loaded for a while, and the user can wait, but this is a taboo in real-time audio and video chat. Fortunately, when the network is bad during real-time audio and video chat, the loss of image frames is not the case. There will be a substantial impact, so for efficiency and real-time experience, the UDP method of RTP/RTCP is the best on the contrary.

Unlike streaming media transmitted on the Internet, IPTV usually uses RTSP + RTP to transmit multimedia data [5]. Because IPTV usually uses a private network for transmission, the network condition is good, there are few problems such as packet loss, delay, jitter, etc., and the simple protocol rules of UDP can greatly improve the transmission efficiency, so you can use RTSP + RTP "with confidence and boldness" mode transmission.

MMS was proposed by Microsoft Corporation. The full name of the MMS protocol is Microsoft Media Server protocol, that is, the Microsoft Media Service Protocol, which is used to access the content on the Windows Media publishing point.

HLS was proposed by Apple. The full name of HLS is HTTP Live Streaming, which is an HTTP-based real-time streaming protocol, which can realize live broadcast and on-demand streaming media. It is mainly used in iOS system to provide audio and video live broadcast and on-demand solutions for iOS devices (such as iPhone and iPad).

RTMP was proposed by Adobe Corporation. The full name of the RTMP protocol is Real Time Messaging Protocol, which is a real-time messaging protocol, which is used to transmit video, audio and data between Flash platforms. Unlike the RTSP + RTP combination that provides streaming services, the RTMP protocol itself can both transmit multimedia data and control multimedia playback.

The RTMP protocol uses the TCP protocol as its transport layer network protocol. TCP is connection-oriented [3] and provides a reliable delivery protocol, so there will be no packet loss when transmitting on the Internet, thus ensuring the user experience (QoE). However, the cost of reliable delivery provided by the TCP protocol is to add some additional overhead, occupying some bandwidth and processor resources. With the improvement of network bandwidth and the development of computer hardware, these expenses will become more and more insignificant. Therefore, the RTMP protocol has a good development prospect in the future.

Guess you like

Origin blog.csdn.net/weikeyuncn/article/details/128252767