1 / 21

Real Time Streaming Protocol

Real Time Streaming Protocol. Akshat Sikarwar Columbia University November 12, 2008. Overview. Introduction Protocol properties RTSP messages Important messages. Introduction. RTSP is like a network remote control for multimedia servers

ting
Télécharger la présentation

Real Time Streaming Protocol

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Real Time Streaming Protocol Akshat Sikarwar Columbia University November 12, 2008

  2. Overview • Introduction • Protocol properties • RTSP messages • Important messages

  3. Introduction • RTSP is like a network remote control for multimedia servers • RTSP establishes and controls streams of continuous media • Streaming data is carried out of band (interleaving is possible)

  4. Protocol Properties • RTSP is text based and HTTP like • Transport independent (can use UDP or TCP) • Unlike HTTP commands can be sent in either direction • RTSP is a stateful protocol. Server maintains session state.

  5. RTSP Connections • RTSP messages can be sent over: • One persistent transport connection for several request-response transactions • One connection per transaction • Connectionless mode • Transport connection != Session • Server can send message to client only in persistent connection

  6. RTSP Reliability • If using reliable transport message is sent just once. • If using unreliable transport, RTSP will retransmit if it does not receive ACK • Timeout is initially set to 500 ms • Can re-compute timeout based on RTT like TCP • For retransmission CSeq is not incremented • Timestamp is used to overcome retransmission ambiguity problem

  7. RTSP URI rtsp://media.example.com:554/twister/audio • rtspidentifies reliable protocol • rtspuidentifies unreliable protocol • Default port is 554 • Presentation: twister • Stream: audio

  8. RTSP Message • Text based messages • Messages use Unicode (ISO 10646) character set encoded using UTF-8 • Lines are terminated by CRLF • Messages can be request or response by either client or server • Message structure is HTTP like

  9. Request Message Method URI Version CRLF Header1:Value CRLF Header2:Value CRLF CRLF Body • First line is Request line • URI is always absolute (unlike HTTP) • URI can be * • Example OPTIONS * RTSP/1.0

  10. Response Message Version Status-Code Reason-Phrase CRLF • Status-Codes are HTTP like • 1xx: Informational • 2xx: Success • 3xx: Redirection • 4xx: Client error • 5xx: Server error • Reason-Phrase is the textual description

  11. RTSP at Work HTTP GET Client Web server Session description Media server PLAY RTP RTCP PAUSE CLOSE From http://www.cs.columbia.edu/~hgs/teaching/ais/slides/2003/RTSP.pdf

  12. RTSP Methods • DESCRIBE Get (low level) description of media object • OPTIONS Get available methods • SETUP Establish transport • PLAY Start playback, reposition • PAUSE Halt delivery, but keep state • RECORD Start recording • ANNOUNCE Change description of media object • REDIRECT Redirect client to new server • GET_PARAMETER Retrieves presentation parameter value • SET_PARAMETER Sets presentation parameter value • TEARDOWN Remove state From http://www.cs.columbia.edu/~hgs/teaching/ais/slides/2003/RTSP.pdf

  13. Method Summary From RFC 2326

  14. Messages in Action Following messages play central role: • SETUP • PLAY • PAUSE • TEARDOWN

  15. SETUP • Specifies the transport mechanism to be used for the streamed media • Transport header specifies the transport parameters acceptable to the client • Response contains transport parameters selected by the server • Server generates session identifiers in response to SETUP requests • Client can issue SETUP to change parameters for already streaming media

  16. SETUP Message Client -> Server: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/1.0 CSeq: 302 Transport: RTP/AVP;unicast;client_port=4588-4589 Server -> Client: RTSP/1.0 200 OK Cseq: 302 Date: 23 Jan 1997 15:35:06 GMT Session: 47112344 Transport: RTP/AVP;unicast; client_port=4588-4589;server_port=6256-6257 From RFC 2326

  17. PLAY • Tells server to start sending data via mechanism specified in SETUP • Plays from beginning to end of range specified • Pauses at end as if PAUSE has been issued • Requests may be pipelined • Range header can have time parameter • Legal to have PLAY without Range header • Scale header can be used to change viewing rate • Can be used for fast forward or rewind

  18. PLAY Message Client -> Server: PLAY rtsp://audio.example.com/twister.en RTSP/1.0 CSeq: 833 Session: 12345678 Range: smpte=0:10:20-;time=19970123T153600Z Server -> Client: RTSP/1.0 200 OK CSeq: 833 Date: 23 Jan 1997 15:35:06 GMT Range: smpte=0:10:22-;time=19970123T153600Z From RFC 2326

  19. PAUSE • Causes stream delivery to halt • Can pause entire presentation or selected stream • Server resources continue to be reserved • Server will terminate session after timeout period expires (specified in SETUP) • Can contain Range header with one value to specify when to pause • Must fall in one of the PLAY ranges

  20. TEARDOWN • Stops delivery of stream • Frees up resources on the server • Can stop single stream or entire presentation • Example Client -> Server: TEARDOWN rtsp://example.com/fizzle/foo RTSP/1.0 CSeq: 892 Session: 12345678 Server -> Client: RTSP/1.0 200 OK CSeq: 892

  21. References • RFC 2326 • Internet Media on Demand : The Real Time Streaming Protocol: http://www.cs.columbia.edu/~hgs/teaching/ais/slides/2003/RTSP.pdf • RTSP: FAQ http://www.cs.columbia.edu/~hgs/rtsp/faq.html

More Related