24
Streaming, RTP, RTSP ITEM, 26feb02, Leif Arne Rønningen

Streaming, RTP, RTSP ITEM, 26feb02, Leif Arne Rønningen

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

Streaming, RTP, RTSPITEM, 26feb02, Leif Arne Rønningen

Streaming from a Streaming Server to a Media player

Iris

W eb b row ser

M ed ia p laye r

Tower box

Tower box

W ebserve r

S tream ingse rve r

C lien t

(1 )H TTP reques t/

response ,descrip tion file

(3 )A ud io /v ideo filereques ted and

sen t

(2 )D escrip -tion file

In te rne t

ITEM, 1nov00 Leif Arne Rønningen

Media Player

• The Media Player shown is a plug-in to the browser (running native code) or a stand-alone application, and provides the following:– Decompression– Jitter removal– Error correction– GUI – Graphical User Interface

Best-effort Quality of Service - QoS

• Internet today, best-effort delivery service– No guarantee of

• End-to-end delay

• Delay jitter

• Packet loss

• Packet sequence

– No traffic control– No admission control

RTP - Real-time Transport Protocol

• One-way streaming, unicast or multicast of audio and video in general

• The media stream is sent as chunks of data, put into RTP packets

• Each RTP packet header includes stream identifier, time stamp and sequence number (error correction)

• On top of UDP/IP• Application and transport layer• Does not provide Quality of service guarantee

RTCP – RTP Control Protocol

• Used with RTP to monitor the Quality of Service• Feedback information can be used for adaptive

control of senders’ output data rates (adaptive scaling of service profile and level)

• On top of UDP/IP• Does not provide Quality of Service guarantee

RTSP - Real-time Streaming Protocol

• Application-level protocol for control over the delivery of data with real-time properties

• Media on-demand control, player-server interaction• Requests and Responses, not memoryless, ’HTTP-

friendly’, supports most HTTP features + new• RTP used for the actual delivery of data (sound,

video)• On top of UDP/IP or TCP/IP• Does not provide Quality of Service guarantee

WebBrowser

WebServer

HTTP GET

Description file

MediaPlayer

MediaServer

RTSP, example

SETUP

PLAY

Media stream

PAUSE

TEARDOWN

RTSP, description file<title>Twister/title><session> <group language=en lipsync>

<switch> <track type=audio

e=”PCMU/8000/1”src= ”rtsp://audio.example.com/twister/ audio.en/lofi”>

<track type=audioe=”DVI4/16000/2” pt=”90 DVI4/8000/1”scr=”rtsp://audio.example.com/twister/ audio.en/hifi”>

</switch><track type=”video/jpeg”

scr=”rtsp://video.example.com/twister/video”> </group></session>

ExplanationThe RTSP Content Markup Language document can be defined using an XML DTD (Document Type Definition), and is HTML-like. Most of it is self-explanatory. The ’group’ includes two audio tracks and a video track, and the ’group’ tag includes the language parameter (en =English) and a requirement that the sound shall be lip-synchronised with the video. The ’swich’ tag indicates that we can swich between two sound tracks. The coding schemes for the audio are given by the parameters ’e’ and ’pt’. To locate resources, RTSP defines a variant of URL, see ’src’. The parameter ’lofi’ indicates ’low fidelity’ sound. The RTSP URL may include a port number.

RTSP, player-server interaction Player: SETUP rtsp://audio.example.com/twister/audio RTSP/1.0

Cseq: 1Transport: rtp/udp; compression; port=3056; mode=PLAY

Server:RTSP/1.0 200 OKCseq: 1Date: 23 Jan 2001 17:45:05 GMTSession: 42311234Transport: rtp/udp; compression; port=3056; mode=PLAY

P: PLAY rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0Cseq: 2Session: 42311234Range: npt=0-

S: RTSP/1.0 200 OKCseq: 3Date: 23 Jan 2001 17:46:05 GMTRange: npt=0-

RTSP, player-server interaction

P: PAUSE rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0Cseq: 4Session: 42311234Range: npt=37

S: RTSP/1.0 200 OKCseq: 4Date: 23 Jan 2001 17:47:05 GMT

P: TEARDOWN rtsp://audio.example.com/twister/audio.en/ lofi RTSP/1.0Cseq: 10Session: 42311234

S: RTSP/1.0 200 OKCseq: 10

ExplanationThe request-response interaction between Player and Server are HTTP-like, but not memoryless. A setup has to be performed before data transfer can take place. The SETUP method is followed by the RTSP URL (universal resource locator). Cseq is a sequence number that uniquely identifies each request-response. The session number identifies the setup session. The RTP protocol shall be used, over UDP. The ’npt’ parameter indicates the ’normal play time’ in seconds. The rest should be self-explanatory.

QuickTime streaming media• QuickTime

– Browser plug-in, or stand-alone QuickTime Player– Retrieve streams from QuckTime Streaming Server– Handles multimedia components like

video, sound, animation, graphics, text, music, 360-degree virtual reality (VR) scenes

stored in every major format– Timecode tracks– RTP and RTSP application protocols– See www.apple.com/quicktime/ for more details

• QuckTime demortsp://129.241.26.182/stud/arne/ice_age_hint.mov

RTSP Media Player-Server, Message Sequence Chart

UserInterface

RTSPPlayer

RTSPServer

OpenURL SETUP

response1

PLAY

response2ActivateRTP

audio

PAUSE

response3Quit TEARDOWN

response10

ActivateRTP

Media Player State-transition diagram

Wait S1

x

Wait UI1

y

Wait S2

Play,RTP

y

Wait S3

z

PassiveO

O

O

O

O

O

OpenURL / SETUP

response1

/ PLAY

Response2 / Activate RTP

/ PAUSE

response3

Media Player State-transition diagram

Wait UI2

Wait S10

z

x

O

O

O – other message

– continue

Quit / TEARDOWN

response10

z

Transition:message in / message out, task

State Machine Implementation

RTPStatedescripton

table

StateInterpreter

State

Message out

Message in

Task or method

SoftwareProcess (entity)

table

Queue

Note: RTP could be implementet as aseparate entity, not as a task

State Interpreter behaviour

• waituntil (at least one message in queue) • get message from queue• check message name• read present state• read state table (state, message in)• set next state• send out message (state, message in)• activate task or function

State Description Table

State message in next state message out task/function

Wait UI2 Quit Wait S10 TEARDOWN,,, ,,,,,, ,,,

Wait S2 response2 Play, RTP activate RTP

Timeouts, retry-counters

TimerRTSPPlayer

OpenURL(N=3) SETUP

(response1 is lost)

(response1 delayed)

SETUP

Set-timer(2, N)

Set-timer(2, N)

Timeout(2,N)

Timeout(2,N)

2 sec.

2 sec.Countdown:If N=0 then begin N:=3; State:=’Passive’ end else N:=N-1;

response1

Extended state machine

Statedescripton

table

StateInterpreter

State, Variable N

Message out

Message in

Tasks or methods

software

table

Queue

Next statedependent onvalue of N

Note: The Timer can be implementedas a task or as a separate entity

xyzxyz

Other streaming media systems

• RealPlayer

• Sun Java Media Framework

• Microsoft Streaming Media• MPEG-21 (coming)

• Other

QoS guarantee

• Packets have to be classified in different traffic classes

• It is desireable to minimise interference between traffic flows

• Resources like link capacity, storage and processing units should be utilised efficiently

• Call admission control is needed. Admission requestes from flows have to include QoS requirements