iceuse
2005-Feb-09 02:15 UTC
[Icecast] Question about range select for static file serve in icecast
Hi, i'm trying to use range in a static file served by icecast 2.2 I can't find an example of an http request. Is something like http://my-icecast-server.com:8000/my-static-file.ogg?range=bytes%3D120000- correct? I can't get that working. Maybe I forgot an option on icecast side. I tried to open that file (without range) in winamp 5, but it downloads all the file while playing and then, I can move into the downloaded file, but It's not what I wanted, because the static file has no end (it is a live dump of a stream served by icecast). (although I don't care about winamp, just want to know how to send my own http request) Thanks, Chris
Michael Smith
2005-Feb-09 02:20 UTC
[Icecast] Question about range select for static file serve in icecast
On Wed, 9 Feb 2005 11:15:15 +0100, iceuse <iceuse@wwlang.net> wrote:> Hi, > i'm trying to use range in a static file served by icecast 2.2 > I can't find an example of an http request. > Is something like > http://my-icecast-server.com:8000/my-static-file.ogg?range=bytes%3D120000- > correct? > I can't get that working. Maybe I forgot an option on icecast side.No. Range is an HTTP header, not a query parameter. Icecast won't understand that at all (it will ignore the query parameters in this case). You can't add HTTP headers just by using a URL, you have to have support in the application itself.> > I tried to open that file (without range) in winamp 5, but it downloads all the > file while playing and then, I can move into the downloaded file, but It's not > what I wanted, because the static file has no end (it is a live dump of a > stream served by icecast). (although I don't care about winamp, just want to > know how to send my own http request)I guess winamp5 doesn't support that, then. Or it might, but it's being confused by the fact that the file is changing in length - I'd expect even a client that DOES support seeking through Range requests to not work correctly when the remote file is dynamically changing. Mike
Iceuse - Kris
2005-Feb-09 23:31 UTC
[Icecast] Question about range select for static file serve in icecast
Michael Smith wrote:>On Wed, 09 Feb 2005 16:56:08 +0100, iceuse@mail.wwlang.net ><iceuse@mail.wwlang.net> wrote: > > >>Yes, but in fact I want to write my own client in Java (based on jorbis). So the question become: >>- is there a restriction on icecast side which may prevent fetching in a file currently growing (I don't think so)? >> >> > >Not really... but it's somewhat limited. I just checked, and actually >icecast has more limited support of Range than I thought. > >It only supports the form where you request "everything from this >point onwards" (for some specified point). The HTTP response given >will be incorrect if the file is growing - if you ignore the >content-length header (generally a bad idea) in your client, it might >work ok. But basically it's really, really not recommended to use >Range on dynamically changing files. > > >this is exactly what I need. I don't bother for the length, as I know in advance what is that file... this is a great feature : your streams can be delayed for any duration... (I plan to have daily dumps, so you can have from 24h to a few sec delay) Otherwise, without range, I'll have to feed the dump into icecast as a stream with an ices playlist (this worked, but then your're limited to a particular delay: if your start ices 1hour after begining the dump, you'll have 1h delay. For multiple delays, you need multiple ices instances. Too much.).>>- what I have to put into my http request to fetch the file? i tried adding a range get variable, but i failed. >> >> > >I think the header should be something like: >Range: bytes=10000- >(to read from 10000 onwards). I haven't checked that, look at the HTTP >spec to confirm it. > > >I'll try and tell you the results on the list.>Mike > > > >p.s. Did you mean to send this to the list? > >yes. regards, Chris
Iceuse - Kris
2005-Feb-13 14:02 UTC
[Icecast] Question about range select for static file serve in icecast
Hello,>I think the header should be something like: >Range: bytes=10000- > >This seams to "work" for fetching the file. But my player (based on JOGG) is unable to recognize the data as an ogg stream, certainly because it receives no ogg header. Maybe something else, but I don't know. Don't know what to do with that... Try to read data until a header is found (may be long as the file is a daily dump of a stream). Chris
Michael Smith
2005-Feb-13 15:34 UTC
[Icecast] Question about range select for static file serve in icecast
On Sun, 13 Feb 2005 23:02:07 +0100, Iceuse - Kris <iceuse@wwlang.net> wrote:> Hello, > > >I think the header should be something like: > >Range: bytes=10000- > > > > > This seams to "work" for fetching the file. But my player (based on > JOGG) is unable to recognize the data as an ogg stream, certainly > because it receives no ogg header. > Maybe something else, but I don't know.Yes, if you're doing this with vorbis data, this will be insufficient. You'll have to do multiple requests, get the headers, etc. Using icecast for this purpose isn't particularly sensible - it's not designed to be a highly efficient complete web server, and the file serving is very limited. Mike