POSTECH DPNM Lab Realtime Streaming Protocol RTSP Byungchul
POSTECH DP&NM Lab Real-time Streaming Protocol (RTSP) Byungchul Park DPNM Lab. , CSE, POSTECH Email: fates@postech. ac. kr 2008. 4. 22 1
POSTECH DP&NM Lab Table of Contents • Introduction • RTSP Message • RTSP Methods • Usage Scenario: Video on Demand • RTSP Applications • Summary 2
POSTECH DP&NM Lab Introduction - Streaming • What is Streaming? – Streaming is the process of playing a file while it is still downloading – Streaming technology lets a user view and hear digitized content – video, sound animation – as it is being downloaded • Streaming breaks the data into packets with size suitable for the transmission between server and clients • RTSP establish and controls streams 3
POSTECH DP&NM Lab Introduction - RTSP • RTSP is an application level protocol for the control of real-time streaming data with syntax and operations similar to HTTP • IEFT standard RFC 2326 (April, 1998) • RTSP uses RTP as the underlying data delivery protocol and offers a VCR-like control to the user: – PLAY, STOP, PAUSE, FF, REW • RTSP = Network remote controller 4
POSTECH DP&NM Lab RTSP vs. RTP • RTSP allows two-way communication – Viewers can communicate with the streaming server and do things like rewind the movie, go to a chapter, and so on – It does not typically deliver the continuous streams itself • RTP is one-way protocol – Send live or stored streams from the server to the client 5
POSTECH DP&NM Lab RTSP vs. HTTP • RTSP has similar syntax and operations with HTTP • Both an RTSP server and client can issue requests • An RTSP server needs to maintain state by default in almost all cases, as opposed to the stateless nature of HTTP • Data is carried out-of-band by a different protocol (RTP) • RTSP has various methods while HTTP has only two methods (GET, POST) 6
POSTECH DP&NM Lab Message Types • RTSP is a text-based protocol and uses UTF-8 (Unicode octet) encoding • Messages can be either requests or responses • Request contain methods, the object the method is operating upon and parameters to further describe the method • After receiving and interpreting request, the recipient replies with a response message • RTSP messages are based on HTTP messages, with slight changes to allow for new status codes and different primitives 7
POSTECH DP&NM Lab RTSP Message • RFC 2616 - HTTP/1. 1 8
POSTECH DP&NM Lab RTSP Methods Method Direction Requirement Description DESCRIBE C->S recommended Get description of media object ANNOUNCE C->S, S->C optional Change description of media object GET_PARAMETER C->S, S->C optional OPTION C->S, S->C required Get available methods PAUSE C->S recommended Halt delivery, but keep state PLAY C->S required Start playback RECORED C->S optional Start recording REDIRECT S->C optional Redirect client to new server SETUP C->S required Establish transport SET_PARAMETER C->S, S->C optional Device or encoding control TEARDOWN C->S required Remove state 9
POSTECH DP&NM Lab Methods - OPTIONS • The OPTIONS method represents a request for information about the communication options available on the request/response chain 10
POSTECH DP&NM Lab Methods - DESCRIBE • The DESCRIBE method retrieves the description of a presentation or media object identified by the request URL from a server. The DESCRIBE replyresponse pair constitutes the media initialization phase of RTSP. • This description can be implemented using the SDP protocol 11
POSTECH DP&NM Lab Methods - ANNOUNCE • When sent from client to server, ANNOUNCE posts the description of a presentation or media object identified by the request URL to a server. When sent from server to client, ANNOUNCE updates the session description in real-time. 12
POSTECH DP&NM Lab Methods - SETUP • The SETUP request for a URI specifies the transport mechanism to be used for the streamed media • The Transport header specifies the transport parameters acceptable to the client for data transmission; the response will contain the transport parameters selected by the server 13
POSTECH DP&NM Lab Methods - PLAY • • • The PLAY method tells the server to start sending data via the mechanism specified in SETUP. A client must not issue a PLAY request until any outstanding SETUP requests have been acknowledged as successful The PLAY request positions the normal play time to the beginning of the range specified and delivers stream data until the end of the range is reached Plays the whole presentation starting at SMPTE time code 0: 10: 20 until the end of the clip. The playback is tart at 15: 36 on 23 Jan 1997. 14
POSTECH DP&NM Lab Methods - PAUSE • The PAUSE request causes the stream delivery to be interrupted temporarily. If the request URL names a stream, only playback and recording of that stream is halted. • If the request URL names a group of streams, delivery of all currently active streams within the group is halted • After resuming playback or recording, synchronization of the tracks must be maintained 15
POSTECH DP&NM Lab Methods - TEARDOWN • The TEARDOWN request stops the stream delivery for the given URI, freeing the resources associated with it. If the URI is the presentation URI for this presentation, any RTSP session identifier associated with the session is no longer valid. Unless all transport parameters are defined by the session description, a SETUP request has to be issued before the session can be played again. 16
POSTECH DP&NM Lab Methods – GET_PARAMETER • The GET_PARAMATER request retrieves the value of a parameter of a presentation or stream specified in the URI. The content of the reply and response is left to the implementation • GET_PARAMETER with no entity body may be used to test client or server liveness (“ping”) 17
POSTECH DP&NM Lab Methods – SET_PARAMETER • This method requests to set the value of a parameter for a presentation or stream specified by the URI. 18
POSTECH DP&NM Lab Methods - REDIRECT • A redirect request informs the client that it must connect to another server location. It contains the mandatory header Location, which indicates that the client should issue requests for that URL. It may contain the parameter Range, which indicates when the redirection takes effect. • If the client wants to continue to send or receive media for this URI, the client MUST issue a TEARDOWN request for the current session and a SETUP for the new session at the designated host. • Useful for implementing server load balancing 19
POSTECH DP&NM Lab Methods - RECORD • This method initiates recording a range of media data according to the presentation description. The timestamp reflects start and end time (UTC). If no time range is given, use the start or end time provided in the presentation description. If the session has already started, commence recording immediately. 20
POSTECH DP&NM Lab Protocol State Machines • The RTSP client and server state machines describe the behavior of the protocol from RTSP session initialization through RTSP session termination 21
POSTECH DP&NM Lab Usage Scenario: Video on Demand 22
POSTECH DP&NM Lab Usage Scenario: Video on Demand 23
POSTECH DP&NM Lab Usage Scenario: Video on Demand 24
POSTECH DP&NM Lab RTSP Applications • • • Streaming of multimedia via Internet Video conferencing and lectures Broadcasting of entertainment Remote digital editing Voice mail • Real-world Application – Real Player (www. real. com/player) – Cisco Application Control Engine (ACE) (http: //www. cisco. com/en/US/prod/collateral/modules/ps 2706/ps 6906/prod_ bulletin 0900 aecd 8045859 e. html) – Nokia 5300 – Unlimited TV On PC (www. thecomputertv. com) – Application Streaming (www. thinstall. com) – Free Premium TV for PC (www. Premium. TVfor. PC. com) – Play. Box Technology (www. playbox. tv) – Etc. 25
POSTECH DP&NM Lab Problems of Current Protocol • The RTSP protocol says nothing about the problems of recovering state over machine or software failure • Quality: packet loss, predictability • No billing infrastructure: pay-per-play? 26
POSTECH DP&NM Lab Summary • RTSP provides an extensible framework to enable controlled, on-demand delivery of real-time data • This protocol is intended to control multiple data delivery sessions, provide a means for choosing delivery channels, and provide a means for choosing delivery mechanisms based upon RTP 27
POSTECH DP&NM Lab Question? ? 28
- Slides: 28