Re: Issue with "bytes" Range Unit and live streaming

Remy Lebeau <remy@lebeausoftware.org> Fri, 15 April 2016 01:25 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BC2E512E16C for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 14 Apr 2016 18:25:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.916
X-Spam-Level:
X-Spam-Status: No, score=-7.916 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.996, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MpI-FQenqcT3 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 14 Apr 2016 18:25:49 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C128F12E14B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 14 Apr 2016 18:25:49 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1aqsRi-0003Yl-NW for ietf-http-wg-dist@listhub.w3.org; Fri, 15 Apr 2016 01:21:18 +0000
Resent-Date: Fri, 15 Apr 2016 01:21:18 +0000
Resent-Message-Id: <E1aqsRi-0003Yl-NW@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <remy@lebeausoftware.org>) id 1aqsRc-0003Xj-Rb for ietf-http-wg@listhub.w3.org; Fri, 15 Apr 2016 01:21:12 +0000
Received: from p3plsmtpa06-02.prod.phx3.secureserver.net ([173.201.192.103]) by lisa.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <remy@lebeausoftware.org>) id 1aqsRa-0001IZ-4n for ietf-http-wg@w3.org; Fri, 15 Apr 2016 01:21:12 +0000
Received: from [192.168.1.13] ([108.184.46.71]) by p3plsmtpa06-02.prod.phx3.secureserver.net with id iRLi1s00A1Y8uW401RLivZ; Thu, 14 Apr 2016 18:20:43 -0700
To: Craig Pratt <craig@ecaspia.com>, IETF HTTP BIS <ietf-http-wg@w3.org>
References: <57102718.7010900@ecaspia.com>
From: Remy Lebeau <remy@lebeausoftware.org>
Organization: Lebeau Software
Message-ID: <571041E0.5020401@lebeausoftware.org>
Date: Thu, 14 Apr 2016 18:20:32 -0700
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <57102718.7010900@ecaspia.com>
Content-Type: multipart/alternative; boundary="------------040300020800080206000103"
Received-SPF: pass client-ip=173.201.192.103; envelope-from=remy@lebeausoftware.org; helo=p3plsmtpa06-02.prod.phx3.secureserver.net
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1aqsRa-0001IZ-4n ae49286b25a52d8350851afa4a2ea580
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Issue with "bytes" Range Unit and live streaming
Archived-At: <http://www.w3.org/mid/571041E0.5020401@lebeausoftware.org>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31469
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

AFAICT, the existing ABNF for byte ranges *does* already support what 
you are looking for, without having to introduce a new unit type:

     byte-range-spec = first-byte-pos "-" [ last-byte-pos ]

Simply omit the * and leave the second value empty:

Range: bytes=1234567-

RFC 2616 Section 14.35.1 says:

"If the last-byte-pos value is absent, or if the value is greater than 
or equal to the current length of the entity-body, last-byte-pos is 
taken to be equal to one less than the current length of the entity- 
body in bytes."

RFC 7233 Section 2.1 says:

"If the last-byte-pos value is absent, or if the value is greater than 
or equal to the current length of the representation data, the byte 
range is interpreted as the remainder of the representation (i.e., the 
server replaces the value of last-byte-pos with a value that is one less 
than the current length of the selected representation)."

Since the media is being recorded while streaming, the client can 
randomly jump around within the recorded portion of the media all it 
wants. Once jumped, it would simply be receiving media from the 
recording, not the live feed.  To jump back to the live feed, simply 
omit the "Range" header.

Remy Lebeau
Lebeau Software

On 4/14/2016 4:26 PM, Craig Pratt wrote:
> Hello all,
>
> We have a use case where we are "live streaming" media over HTTP. As 
> with other (non-segmented) HTTP streaming applications, our live 
> streaming solution has the HTTP client perform a GET on a URI 
> representing the live audio or video content stream and with the 
> server progressively returning data using chunked transfer coding. The 
> data returned to the server is "live" so long as the client reads data 
> as quickly as it's generated - with TCP flow control allowing the 
> client's reading of the response data to be paced to the live chunk 
> generation of the HTTP server.
>
> More recently, use cases have appeared that require a combination of 
> random access and live streaming. For example, an HTTP media server 
> may want to support streaming of an in-progress recording - with the 
> HTTP client using HTTP byte Range requests to access any point within 
> the already-recorded content. But we've run into issues supporting 
> both live content transfer and HTTP byte Range requests on the same 
> resource. There's no good way that we've found to get to this "live 
> point" and also support random access. The use case requires a byte 
> range that ends at an indeterminate point, e.g.
>
> Range: bytes=1234567-*
>
> However, the ABNF for the bytes Range Unit doesn't allow for this form 
> of request.
>
> Rather than coming up with a proprietary solution, we are proposing a 
> new Range Unit called "bytes-live" as a potential solution to this 
> issue. Support for this new "bytes-live" Range Unit could be exposed 
> by servers (using the Accept-Ranges header) for content that support 
> both byte-wise random access and live streaming. e.g. A server that 
> supports both the standard HTTP/1.1 bytes Range Unit and bytes-live 
> would include the header:
>
> Accept-Ranges: bytes bytes-live
>
> An HTTP client can use Range requests with the standard "bytes" Range 
> Unit to transfer stored content from a representation. And when the 
> bytes-live Range Unit is supported, an HTTP client can request a byte 
> range that starts or ends at the live point of the content 
> representation. For example, a client could request the transfer of 
> bytes starting at byte 1234567 and transitioning to the live point 
> once all stored content has been transferred using:
>
> Range: bytes-live=1234567-*
>
> We believe the bytes-live Range Unit could have multiple applications 
> outside of our immediate use cases. For instance, internet-connected 
> video cameras with on-board storage could use bytes-live to support 
> streaming of continuously recording content with lower latencies than 
> can be achieved using HLS, MPEG-DASH, or other segmented video 
> streaming techniques. And there are also applications with on-demand 
> transcoding.
>
> The draft RFC can be found here 
> https://tools.ietf.org/html/draft-pratt-httpbis-bytes-live-range-unit-00. 
> Please let me know what you think - and if there are other solutions 
> we haven't considered.
>
> Regards,
>
> craig
> -- 
>
> craig pratt
>
> Caspia Consulting
>
> craig@ecaspia.com
>
> 503.746.8008
>
> 	
>
>
> 	
>
>
>