Reprint: http://easydarwin.org/article/Streaming/141.html
The similarities and differences between RTSP, RTMP, and HTTP
Common:
1:RTSP RTMP HTTP is applied at the application layer.
2: Theoretically RTSP rtmphttp can do live and on-demand, but generally do live with RTSP RTMP, do on-demand http. Video conferencing when the original SIP protocol, and now basically replaced by the RTMP protocol.
Difference:
1:http: Hypertext Transfer Protocol (FTP is a file Transfer Protocol).
HTTP: (Real Time streaming Protocol), live streaming protocol.
HTTP Full Name routing table maintenance Protocol (Routing Table Maintenance Protocol).
2:http all the data as a file. The HTTP protocol is not a streaming media protocol.
RTMP and RTSP protocols are streaming media protocols.
The 3:rtmp agreement is Adobe's private agreement, which is not fully disclosed, and the RTSP protocol and the HTTP protocol are common agreements and have specialized agencies for maintenance.
The 4:RTMP protocol generally transmits the FLV,F4V format stream, and the RTSP protocol generally transmits a stream in the Ts,mp4 format. HTTP does not have a specific stream.
5:RTSP transmission generally requires 2-3 channels, command and Data channel separation, HTTP and rtmp generally on a TCP channel to transmit commands and data.
RTSP, RTCP, RTP differences
1:RTSP Real-Time Streaming protocol
As an application-level protocol, RTSP provides an extensible framework that makes it possible to control and on-demand real-time streaming media data. In general, RTSP is a streaming media representation protocol that is primarily used to control data transmission with real-time characteristics, but it does not transmit data by itself, but must rely on some of the services provided by the underlying transport protocol. RTSP can provide streaming media such as play, pause, fast forward and other operations, it is responsible for defining the specific control message, operation method, status code, etc., also describes the interaction with RTP (RFC2326).
2:RTCP Control Protocol
The RTCP control protocol needs to be used in conjunction with the RTP data protocol, and when an application initiates an RTP session, it consumes two ports, respectively, for RTP and RTCP. RTP by itself does not provide a reliable guarantee for sequential transmission of packets, nor does it provide traffic control and congestion control, which is done by RTCP. Typically, the RTCP uses the same distribution mechanism as RTP to periodically send control information to all members of the session, and the application receives the data, obtains information about the session participants, and feedback such as network conditions, packet loss probabilities, and so on to the quality of service into control or diagnose network conditions.
The functions of the RTCP protocol are implemented by different RTCP datagrams, mainly in the following categories:
SR: Send-side report, the so-called sender is the application or terminal to emit RTP datagram, the sender can also be the receiving side. (server time is sent to client).
RR: The receiving side reports that the so-called receiver is the application or terminal that receives but does not send RTP datagrams. (The server receives a response sent by the client side).
SDEs: Source Description, the main function is as a member of the session on identity information carrier, such as user name, e-mail address, telephone number, and also has the ability to communicate session control information to the session members.
BYE: Notification departure, the primary function is to indicate that one or several sources are no longer valid, that is, the other members in the notification session will exit the session themselves.
App: defined by the application itself, it solves the extensibility problem of RTCP and provides a great deal of flexibility for the implementation of the Protocol.
3:RTP Data Protocol
RTP Data Protocol is responsible for the streaming media data packets and the real-time transmission of media streams, each RTP datagram by the head (header) and load (Payload) two parts, wherein the head of the first 12 bytes meaning is fixed, while the load can be audio or video data.
The place that RTP uses is PLAY, the server transmits data to the client with the UDP protocol, RTP is a 12-byte header (description information) in front of the transmitted data.
RTP Payload Package Design This paper's network transmission is based on the IP protocol, so the maximum transmission Unit (MTU) maximum of 1500 bytes, when using the IP/UDP/RTP protocol hierarchy, which includes at least 20 bytes of IP header, 8 bytes of UDP header, and 12 bytes of RTP header. This way, the header information takes at least 40 bytes, and the maximum size of the RTP payload is 1460 bytes. Taking H264 as an example, if a frame of data is greater than 1460, it needs to be fragmented and then unpacked to the receiving end and then assembled into one frame of data for decoding playback.
The difference between RTSP protocol, RTMP protocol, and HTTP protocol