在流媒体传输 - RTSP 协议中,我们分析 RTSP 协议交互的整个流程,在本篇文章中,我们对交互中携带的报文进行详细分析。
- 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-Line = Method SP Request-URI SP RTSP-Version CRLF
-
- 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
-
- SP = space
-
- extension-method = token
-
- Request-URI = "*" | absolute_URI
-
- RTSP-Version = "RTSP" "/" 1*DIGIT "." 1*DIGIT
注意,与 HTTP / 1.1 相比,RTSP 请求始终包含绝对 URL(即,包括 方案、主机、端口),而不仅仅是绝对路径。 Request-URI 中的星号 "*" 表示该请求不适用于特定资源,而是适用于服务器本身,并且仅在所使用的方法不一定适用于资源时才被允许。比如: >
OPTIONS * RTSP/1.0
- request-header = Accept ; Section 12.1
- | Accept-Encoding ; Section 12.2
- | Accept-Language ; Section 12.3
- | Authorization ; Section 12.5
- | From ; Section 12.20
- | If-Modified-Since ; Section 12.23
- |