Real Time Streaming Protocol (RTSP) - 实时流协议

Real Time Streaming Protocol (RTSP) - 实时流协议

The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems to control streaming media servers. The protocol is used for establishing and controlling media sessions between end points. Clients of media servers issue VHS-style commands, such as play, record and pause, to facilitate real-time control of the media streaming from the server to a client (Video On Demand) or from a client to the server (Voice Recording).
实时流协议 (Real Time Streaming Protocol,RTSP) 是一种网络应用协议,专为娱乐和通信系统的使用,以控制流媒体服务器。该协议用于创建和控制终端之间的媒体会话。媒体服务器的客户端发布 VHS-style 命令,例如播放、录制和暂停,以便于实时控制从服务器到客户端 (视频点播) 或从客户端到服务器 (语音录音) 的媒体流。

The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery. However, some vendors implement proprietary transport protocols. The RTSP server software from RealNetworks, for example, also used RealNetworks’ proprietary Real Data Transport (RDT).
流数据自身的传输不是 RTSP 的任务。大多数 RTSP 服务器使用实时传输协议 (RTP) 和实时控制协议 (RTCP) 结合媒体流传输。然而,一些供应商实现专有传输协议。例如,RealNetworks 公司的 RTSP 服务器软件也使用 RealNetworks 的专有实时数据传输 (RDT)。

RTSP was developed by RealNetworks, Netscape and Columbia University, with the first draft submitted to IETF in 1996. It was standardized by the Multiparty Multimedia Session Control Working Group (MMUSIC WG) of the Internet Engineering Task Force (IETF) and published as RFC 2326 in 1998. RTSP 2.0 published as RFC 7826 in 2016 as a replacement of RTSP 1.0. RTSP 2.0 is based on RTSP 1.0 but is not backwards compatible other than in the basic version negotiation mechanism.
RTSP 由 RealNetworks 公司、Netscape 公司和哥伦比亚大学开发,第一稿于 1996 年提交给 IETF。由互联网工程任务组 (IETF) 的多方多媒体会话控制工作组 (MMUSIC WG) 进行了标准化,并于 1998 年发布为 RFC 2326。RTSP 2.0 于 2016 年发布为 RFC 7826,作为 RTSP 1.0 的替代品。RTSP 2.0 基于 RTSP 1.0,但不是在基本版本协商机制之外的向后兼容。

protocol ['prəʊtəkɒl]:n. 协议,草案,礼仪 vt. 拟定 vi. 拟定
facilitate [fə'sɪlɪteɪt]:vt. 促进,帮助,使容易

1. Protocol directives - 协议指令

While similar in some ways to HTTP, RTSP defines control sequences useful in controlling multimedia playback. While HTTP is stateless, RTSP has state; an identifier is used when needed to track concurrent sessions. Like HTTP, RTSP uses TCP to maintain an end-to-end connection and, while most RTSP control messages are sent by the client to the server, some commands travel in the other direction (i.e. from server to client).
虽然在某些方面与 HTTP 类似,RTSP 定义了控制多媒体播放控制顺序。虽然 HTTP 是无状态的,但 RTSP 具有状态。当需要跟踪并发会话时使用标识符。像 HTTP 一样,RTSP 使用 TCP 来维护端到端连接,而大多数 RTSP 控制消息由客户端发送到服务器,一些命令沿着另一个方向 (即从服务器到客户端) 传播。

Presented here are the basic RTSP requests. Some typical HTTP requests, like the OPTIONS request, are also available. The default transport layer port number is 554 for both TCP and UDP, the latter being rarely used for the control requests.
这里提供了基本的 RTSP 请求。一些典型的 HTTP 请求,如 OPTIONS 请求也可用。对于 TCP 和 UDP,默认传输层端口号为 554,后者很少用于控制请求。

directive [daɪ'rektɪv; dɪ'rektɪv]:n. 指示,指令 adj. 指导的,管理的
concurrent [kən'kʌr(ə)nt]:adj. adj. 并发的,一致的,同时发生的,并存的 n. 共点,同时发生的事件

1.1 OPTIONS - OPTIONS 请求

An OPTIONS request returns the request types the server will accept.
OPTIONS 请求返回服务器将接受的请求类型。 (C 代表客户端,S 代表服务端)

C->S:  OPTIONS rtsp://example.com/media.mp4 RTSP/1.0
       CSeq: 1
       Require: implicit-play
       Proxy-Require: gzipped-messages

S->C:  RTSP/1.0 200 OK
       CSeq: 1
       Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE

1.2 PLAY - PLAY 播放请求

A PLAY request will cause one or all media streams to be played. Play requests can be stacked by sending multiple PLAY requests. The URL may be the aggregate URL (to play all media streams), or a single media stream URL (to play only that stream). A range can be specified. If no range is specified, the stream is played from the beginning and plays to the end, or, if the stream is paused, it is resumed at the point it was paused.
Play 播放请求将导致播放一个或所有媒体流。可以通过发送多个播放请求来堆叠播放请求。URL 可以是聚合 URL (播放所有媒体流) 或单个媒体流 URL (仅播放该流)。可以指定范围。如果没有指定范围,流将从头开始播放,并播放到最后,或者如果流暂停,则在暂停点恢复播放。

C->S: PLAY rtsp://example.com/media.mp4 RTSP/1.0
      CSeq: 4
      Range: npt=5-20
      Session: 12345678

S->C: RTSP/1.0 200 OK
      CSeq: 4
      Session: 12345678
      RTP-Info: url=rtsp://example.com/media.mp4/streamid=0;seq=9810092;rtptime=3450012

RTSP using RTP and RTCP allows for the implementation of rate adaptation.
使用 RTP 和 RTCP 的 RTSP 允许实现速率适配。

References

https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol
Real Time Streaming Protocol (RTSP) - 中文版

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 成长之路 设计师:Amelia_0503 返回首页