Subject: RTSP URLs vs StreamIDs - we need both

From: Alagu Periyannan <[email-masked]>
Date: Fri, 18 Jul 1997 14:52:08 -0700

Hi all,

The current discussion in the RTSP group has primarily
focused on using an RTSP URL to specify a media stream
within a presentation. I thought the group had reached a
consensus on using StreamIDs, but this clearly is not the case
from seeing the recent email activity.

Firstly, what do we see as the pros for URLs vs StreamIDs?

Pros for RTSP URLs:
------------------

- A URL can be transparently used by the client. The server gets
to choose what goes in it.

- It is possible to provide a URL for just one of the media streams
within a presentation.

     Example:
          rtsp://foo.com/dinosaurs.mov/trackid=video
          This URL can be use to DESCRIBE, SETUP and PLAY just the video
          stream in the Dinosaurs movie.

Pros for StreamIDs:
------------------

- The response to a multi-stream PLAY (when RTP is used as a transport)
needs to pass back RTP sequence numbers for each stream. If we
drop StreamIDs, we will need to use the entire RTSP URL of each
stream to associate a sequence number with that stream. This will
look ugly and will be hard to parse.

- With the 1-1-n scheme, we can now do SETUPs for all the
media streams over the same RTSP Session ID. If we drop StreamIDs,
then we will have no means of doing TEARDOWNs corresponding
to each SETUP. (This may not be a major problem if the
TEARDOWN can specify the URL of the media stream being
torn down.)

Given the situation that both URLs and StreamIDs have their
unique advantages, why not use a combination of both?
Below is a proposal to do just that.

- RTSP URLs will be used in the SDP file to identify each media
stream. The format of these URLs will hopefully be resolved
in the current email discussions in confctrl list. Since the
client is going to use it transparently, this format should
really not matter.

- StreamIDs are no longer specified in the SDP file. Instead
they are random IDs (similar to Session IDs) that are
returned to the client by the server in the response to
a SETUP. The scope of a StreamID is within a Session.

Here is an example of this scheme for a movie that
contains and audio, video and text stream.

   C->S: DESCRIBE rtsp://foo.com/dinosaurs.mov RTSP/1.0 1
         Accept: application/sdp

   S->C: RTSP/1.0 200 1 OK
         Content-Type: application/sdp

         s=RTSP Session
         r = rtsp://foo.com/dinosaurs.mov                    // aggregate URL
         m=audio 0 RTP/AVP 0
         r = rtsp://foo.com/dinosaurs.mov/track=0      // audio URL
         m=video 0 RTP/AVP 31
         r = rtsp://foo.com/dinosaurs.mov/track=1      // video URL
         m=text 0 RTP/AVP 99
         r = rtsp://foo.com/dinosaurs.mov/track=2      // text URL

   C->S: SETUP rtsp://foo.com/dinosaurs.mov/track=0 RTSP/1.0 1
         Transport: rtp/udp;port=3056,
                    rtp/tcp

   S->C: RTSP/1.0 200 1 OK
         Session: 1234
         StreamID: 3336
         Transport: rtp/udp;port=3056;servport=5545;servaddress=17.128.200.111

   C->S: SETUP rtsp://foo.com/dinosaurs.mov/track=1 RTSP/1.0 2
          Session: 1234
        Transport: rtp/udp;port=3058,
                    rtp/tcp

   S->C: RTSP/1.0 200 2 OK
         Session: 1234
         StreamID: 3337
         Transport: rtp/udp;port=3058;servport=5547;servaddress=17.128.200.111

   C->S: SETUP rtsp://foo.com/dinosaurs.mov/track=2 RTSP/1.0 3
         Session: 1234
         Transport: rtp/udp;port=3060,
                    rtp/tcp

   S->C: RTSP/1.0 200 3 OK
         Session: 1234
         StreamID: 3338
         Transport: rtp/udp;port=3060;servport=5549;servaddress=17.128.200.111

   C->S: PLAY rtsp://foo.com/dinosaurs.mov RTSP/1.0 4
         Session: 1234

   S->C: RTSP/1.0 200 4 OK
         Session: 1234
         TransportInfo: rtp/udp;StreamID=3336&Sequence=32434
                                 StreamID=3337&Sequence=12334;
                                 StreamID=3338&Sequence=2342;

Now the user wishes to disable the text track,

   C->S: TEARDOWN rtsp://foo.com/dinosaurs.mov/track=2 RTSP/1.0 5
         Session: 1234
         StreamID: 3338

   S->C: RTSP/1.0 200 5 OK
         Session: 1234
         StreamID: 3338

Note: I added a new header called "TransportInfo:" to the PLAY method. This
can be used to return transport specific info. in the PLAY method and
response. I also added 2 parameters to the Transport header called
"servport" which is the server's RTCP port and "servaddress" which is the
server's IP address.

---------------------------------------------------
Alagu Periyannan                   [email-masked]

Interactive Multimedia Group
Apple Computer, Inc.