RTSP-RFC2326 protocol format Analysis 1 application layer protocol, control the transmission of real-time data streams, the Protocol aims to control multiple data transmission links, select the channel for sending, such as UDP, multicast UDP and TCP. many methods have nothing to do with the RTSP status, but the following methods are very important: SETUP, PLAY, RECORD, PAUSE, TEARDOWN. ~~~~~~~~~~~ SETUP: Let the server allocate resources to the stream and start the RTSP session. PLAY & RECORD: Start the data transmission of the SETUP allocation stream. PAUSE: PAUSE the stream, but do not release the stream resources. TEARDOWN: releases all resources and ends the session. Note: In response to the SETUP Request, the server generates the session ID. all methods are as follows: Method = "DESCRIBE"; Section 10.2 | "ANNOUNCE"; Section 10.3 | "GET_PARAMETER"; Section 10.8 | "OPTIONS"; Section 10.1 | "PAUSE "; section 10.6 | "PLAY"; Section 10.5 | "RECORD"; Section 10.11 | "REDIRECT"; Section 10.10 | "SETUP"; Section 10.4 | "SET_PARAMETER "; section 10.9 | "TEARDOWN"; Section 10.7 | extension-method ~~~~~~~~~~~~~~~~~~ Description of the transport layer bearer mode used by the RTSP/RTSPU Protocol: rtsp requires the use of reliable protocol (TCP) bearer commands, while rtspu uses unreliable protocol (UDP ). That is to say, our common rtsp protocol is based on the TCP protocol. ~~~~~~~~~~~~~~~~~~~~~~~ About Port: If the URL in rtsp does not specify a port, port 554 is used by default. This is different from HTTP. About timestamp: Format: --- hour: minute: Second: frame. sub-frame hours: minutes: seconds: frames. subframes ~~~~~~~~ RTSP text-based protocol, using UTF-8 encoding scheme, line with CRLF interrupt ,~~~~~~~~~~~~~ The Request body is in the following format: Request = request-Line; Section 6.1 * (general-header; Section 5 | Request-header; Section 6.2 | entity-header ); section 8.1 CRLF [message-body]; Section 4.3 ~~~~~~~~~~~ Request-header: request-header = Accept; Section 12.1 | xxxxxxxxxxxxxxx; Section 12.2 | Accept-Language; Section 12.3 | Authorization; Section 12.5 | From; section 12.20 | If-Modified-Since; Section 12.23 | Range; Section 12.29 | Referer; Section 12.30 | User-Agent; Section 12.41 ~~~~~~~~~~~ Response body: response = Status-Line; Section 7.1 * (general-header; Section 5 | Response-header; Section 7.1.2 | entity-header ); section 8.1 CRLF [message-body]; Section 4.3 ~~~~~~~~~ Response-header = Location; Section 12.25 | Proxy-Authenticate; Section 12.26 | Public; Section 12.28 | Retry-After; Section 12.31 | Server; Section 12.36 | Vary; section 12.42 | WWW-Authenticate; Section 12.44 ~~~~~~~~~~~~~ Description of the method: describe c-> s p, S suggests announce c-> S, S-> c p, S optional GET_PARAMETER C-> S, S-> c p, S Optional options c-> S, S-> c p, S must be (S-> C: OPTIONAL) pause c-> s p, S recommended play c-> s p, S must be record c-> s p, S optional redirect s-> c p, S optional setup c-> S must be SET_PARAMETER C-> S, S-> c p, S optional teardown c-> s p, S required