Subject: Re: [MMUSIC] RTSP: Open Ranges

From: Magnus Westerlund <[email-masked]>
Date: Mon, 01 Dec 2008 11:01:30 +0100

Hi,

When starting to look at the text and editing this in I found the range
header text to be lacking in clarity. Thus I added more definitions on
this to try to making it clear. Please review the following text
(paragraph 5 (The Range header contains a list ..) to 7 is changed):

16.38.  Range

   The Range header specifies a time range in PLAY (Section 13.4), PAUSE
   (Section 13.6), SETUP (Section 13.3), REDIRECT (Section 13.10), and
   PLAY_NOTIFY (Section 13.5) requests and responses.

   The range can be specified in a number of units.  This specification
   defines smpte (Section 4.4), npt (Section 4.5), and clock
   (Section 4.6) range units.  While byte ranges [H14.35.1] and other
   extended units MAY be used, their behavior is unspecified since they
   are not normally meaningful in RTSP.  Servers supporting the Range
   header MUST understand the NPT range format and SHOULD understand the
   SMPTE range format.  If the Range header is sent in a time format
   that is not understood, the recipient SHOULD return 456 (Header Field
   Not Valid for Resource) and include an Accept-Ranges header
   indicating the supported time formats for the given resource.

   The Range header MAY contain a time parameter in UTC, specifying the
   time at which the operation is to be made effective.  This
   functionality MUST be used only with the REDIRECT method.

   Example:
     Range: clock=19960213T143205Z-;time=19970123T143720Z

      The notation is similar to that used for the HTTP/1.1 [RFC2616]
      byte-range header.  It allows clients to select an excerpt from
      the media object, and to play from a given point to the end as
      well as from the current location to a given point.

   The Range header contains a list with one or more ranges of one
   single range format.  Ranges are half-open intervals with a start and
   an end point, including the start point, but excluding the end point.
   A range may either be fully specified with explicit values for start
   point and end point, or have either start or end point be implicit.
   An implict start point indicates the session's pause point, and if no
   pause point is set the start of the content.  An implict end point
   indicates the end of the content.  Implicit start point SHALL NOT be
   used in any range that isn't the first in the list present in the
   header.  The usage of implict start and end point is not allowed in
   the range header, however, the exclusion of the range header has that
   meaning, i.e. from pause point (or start) until end of content.

      Regarding the half-open intervals; a range of A-B starts exactly
      at time A, but stops just before B. Only the start time of a media
      unit such as a video or audio frame is relevant.  For example,
      assume that video frames are generated every 40 ms.  A range of
      10.0-10.1 would include a video frame starting at 10.0 or later
      time and would include a video frame starting at 10.08, even
      though it lasted beyond the interval.  A range of 10.0-10.08, on
      the other hand, would exclude the frame at 10.08.

      Please note the difference between NPT time scales' "now" and an
      implicit start value.  Implicit value reference the current pause-
      point.  While "now" is the currently ongoing time.  In a time-
      progressing session with recording (retention for some or full
      time) the pause point may be 2 min into the session while now
      could be 1 hour into the session.

   By default, range intervals increase, where the second point is
   larger than the first point.

   Example:
       Range: npt=10-15

   However, range intervals can also decrease if the Scale header (see
   Section 16.44) indicates a negative scale value.  For example, this
   would be the case when a playback in reverse is desired.

   Example:
       Scale: -1
       Range: npt=15-10

   Decreasing ranges are still half open intervals as described above.
   Thus, for range A-B, A is closed and B is open.  In the above
   example, 15 is closed and 10 is open.  An exception to this rule is
   the case when B=0 in a decreasing range.  In this case, the range is
   closed on both ends, as otherwise there would be no way to reach 0 on
   a reverse playback for formats that have such a notion, like NPT and
   SMPTE.

   Example:
       Scale: -1
       Range: npt=15-0

   In this range both 15 and 0 are closed.

   A decreasing range interval without a corresponding negative Scale
   header is not valid.

Magnus Westerlund skrev:
> Hi,
> 
> This is to discuss the following issues submitted by Christian Haas:
> https://sourceforge.net/support/tracker.php?aid=2038471
> 
>> Ranges may have an open start time (e.g.: "npt=-40") that refer to the
>> current play/pause position to be used as start.
>> (A sidenote: The ABNFs of the ranges don't have the first time optional)
>>
>> Ranges may also be open ended (e.g.: "npt=0-") requesting to play until the
>> end, whenever that is.
>>
>> As a result, a 'fully' open range could be valid as well (e.g.: "npt=-"),
>> meaning "Play from wherever the position is now until the end of the
>> presentation, whenever that is".
>> Thinking further, would then there be a difference between "npt=-" and
>> "npt=now-"? As a result, the "now" constant could be dropped.
> 
> First, the current ABNF says the following:
> 
> 
>   ranges-spec          =  npt-range / utc-range / smpte-range
>                        /  range-ext
>    smpte-range        =  smpte-type "=" smpte-range-spec
>                          ; See section 3.4
>    smpte-range-spec   =  ( smpte-time "-" [ smpte-time ] )
>                       /  ( "-" smpte-time )
> 
>    npt-range        =  "npt=" npt-range-spec
>    npt-range-spec   =  ( npt-time "-" [ npt-time ] ) / ( "-" npt-time )
> 
>    utc-range        =  "clock=" utc-range-spec
>    utc-range-spec   =  ( utc-time "-" [ utc-time ] ) / ( "-" utc-time )
> 
> Which allows either: either value-, value-value or -value. It does not
> allow just -.
> 
> I would also like to point out that there is a difference between now
> and no value. No value reference the current pause-point. While now is
> the currently ongoing time. In a time-progressing session with recording
> (retention for some or full time) the pause point may be 2 min into the
> session while now could be 1 hour into the session.
> 
> So in my mind - would mean from pause point until end. But that is
> equivalent to no Range header. So we already have that functionality.
> 
> I would propose no change as a resolution.
> 
> Cheers
> 
> Magnus Westerlund
> 
> IETF Transport Area Director & TSVWG Chair
> ----------------------------------------------------------------------
> Multimedia Technologies, Ericsson Research EAB/TVM
> ----------------------------------------------------------------------
> Ericsson AB                | Phone +46 8 4048287
> Färögatan 6                | Fax   +46 8 7575550
> S-164 80 Stockholm, Sweden | mailto: [email-masked]
> ----------------------------------------------------------------------
> _______________________________________________
> mmusic mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/mmusic
> 

-- 

Magnus Westerlund

IETF Transport Area Director & TSVWG Chair
----------------------------------------------------------------------
Multimedia Technologies, Ericsson Research EAB/TVM
----------------------------------------------------------------------
Ericsson AB                | Phone  +46 10 7148287
Färögatan 6                | Mobile +46 73 0949079
SE-164 80 Stockholm, Sweden| mailto: [email-masked]
----------------------------------------------------------------------
_______________________________________________
mmusic mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/mmusic

---

From: Joe Pallas <[email-masked]>
Date: Mon, 1 Dec 2008 10:52:58 -0800

On Dec 1, 2008, at 2:01 AM, Magnus Westerlund wrote:

>    The usage of implict start and end point is not allowed in

Just for added clarity, I would suggest:

The usage of [both] implicit start and end point is not allowed in  
the [same] range header ....

joe

---

From: Magnus Westerlund <[email-masked]>
Date: Tue, 02 Dec 2008 09:53:27 +0100

Joe Pallas skrev:
> The usage of [both] implicit start and end point is not allowed in the
> [same] range header ....
> 

Thanks,

added in the source.

Cheers

Magnus Westerlund