Best way to streaming audio and video files from elliptics

92 views
Skip to first unread message

Alexey Timofeyev

unread,
Dec 10, 2015, 9:53:25 AM12/10/15
to reverbrain
Hello,

I have question about streaming audio and video over backrunner and nginx.
Can backrunner understand headers Range?
When using scheme http://doc.reverbrain.com/elliptics:streaming-tutorial#nginx_streaming_from_eblob with redirect from backrunner to nginx with eblob module it is possible to transfer the headers X-Accell-Redirect from backrunner to nginx?

What better workaround for streaming audio and video from the elliptic?

Some browsers like Safary can't handle audio and video files normally from backrunner, we want to find best way to streaming.

Evgeniy Polyakov

unread,
Dec 10, 2015, 10:04:01 AM12/10/15
to Alexey Timofeyev, reverbrain
Hi Alexey

10.12.2015, 17:53, "Alexey Timofeyev" <timo...@playform.com>:
> I have question about streaming audio and video over backrunner and nginx.
> Can backrunner understand headers Range?

No, we didn't implement them, since there were no requests for that.
One can use size/offset URI parameters, if it is not enough (why?) we could add range header parsing.

> When using scheme http://doc.reverbrain.com/elliptics:streaming-tutorial#nginx_streaming_from_eblob with redirect from backrunner to nginx with eblob module it is possible to transfer the headers X-Accell-Redirect from backrunner to nginx?

No, backrunner doesn't set dynamic headers, you can only add static headers via config file.

Usually streaming is handled a bit differently - backrunner's /lookup/ handler returns json
with all information, and frontend generates appropriate URL to pass to nginx+eblob module
either from the client player or from frontend itself.

There is /redirect/ handler in backrunner which is example of this logic implemented in backrunner itself,
it generates 301 redirect to the url handled by nginx+eblob module.

> What better workaround for streaming audio and video from the elliptic?
>
> Some browsers like Safary can't handle audio and video files normally from backrunner, we want to find best way to streaming.

Are you talking about streaming from eblob or reading file via /get/ backrunner handler?
The latter just returns requested piece of file, this is just what was written into the storage.
The former may add various headers (like flv header for the appropriate streaming).

Alexey Timofeyev

unread,
Dec 14, 2015, 4:53:07 AM12/14/15
to reverbrain, timo...@playform.com, z...@ioremap.net
Hi, Evgeniy

We made a patch for backrunner that add functionality to work with Range headers. Does it all correctly done, whether it have some errors? 

четверг, 10 декабря 2015 г., 18:04:01 UTC+3 пользователь Evgeniy Polyakov написал:
patch_getpart.txt

Evgeniy Polyakov

unread,
Dec 14, 2015, 7:26:16 PM12/14/15
to Alexey Timofeyev, reverbrain
Hi Alexey

14.12.2015, 12:53, "Alexey Timofeyev" <timo...@playform.com>:
> We made a patch for backrunner that add functionality to work with Range headers. Does it all correctly done, whether it have some errors?

What about adding this into generic helper function like URIOffsetSize() ?

Also, what to do with range queries which span multiple ranges like
Range: 0-1000,2000-3000,4000-5000,6000-

Does anyone use such range queries in practice?

Alexey Timofeyev

unread,
Dec 16, 2015, 9:20:59 AM12/16/15
to reverbrain, timo...@playform.com, z...@ioremap.net


вторник, 15 декабря 2015 г., 3:26:16 UTC+3 пользователь Evgeniy Polyakov написал:
Hi Alexey

14.12.2015, 12:53, "Alexey Timofeyev" <timo...@playform.com>:
> We made a patch for backrunner that add functionality to work with Range headers. Does it all correctly done, whether it have some errors?

What about adding this into generic helper function like URIOffsetSize() ?

We have decided that the right to make a separate uri that does not infringe any of the current functional, and therefore we implemented function in this way.


Also, what to do with range queries which span multiple ranges like
Range: 0-1000,2000-3000,4000-5000,6000-

Does anyone use such range queries in practice?

 Multirange requests we have not met in our practice for video and audio. Maybe they used by the download managers. 

Evgeniy Polyakov

unread,
Dec 22, 2015, 11:00:20 AM12/22/15
to Alexey Timofeyev, reverbrain
Hi Alexey

16.12.2015, 17:21, "Alexey Timofeyev" <timo...@playform.com>:
>>> We made a patch for backrunner that add functionality to work with Range headers. Does it all correctly done, whether it have some errors?
>>
>> What about adding this into generic helper function like URIOffsetSize() ?
> We have decided that the right to make a separate uri that does not infringe any of the current functional, and therefore we implemented function in this way.
>
>> Also, what to do with range queries which span multiple ranges like
>> Range: 0-1000,2000-3000,4000-5000,6000-
>>
>> Does anyone use such range queries in practice?
>
>  Multirange requests we have not met in our practice for video and audio. Maybe they used by the download managers.

We've implemented full-featured RFC 2616 Range header support with proper MIME boundary setting.
There is also If-Modified-Since support.

Changes are available in git tree, you will have to update both elliptics-go and backrunner in order to get new features.
Documentation page is also updated http://doc.reverbrain.com/backrunner:uri
There is no size/offset URI parameters anymore, since they would be confused with Range header.
Range header will be parsed for upload, get and redirect handlers.

Alexey Timofeyev

unread,
Dec 25, 2015, 8:34:29 AM12/25/15
to reverbrain, timo...@playform.com, z...@ioremap.net
Hi, Evgeniy

Thank you for to realize the full implementation of Range headers. We will try to test in our cases.

Now, when build from master I get this error:

go build
./proxy.go:462: too many arguments in call to proxy.bctl.Stat


вторник, 22 декабря 2015 г., 19:00:20 UTC+3 пользователь Evgeniy Polyakov написал:

Evgeniy Polyakov

unread,
Dec 25, 2015, 8:41:56 AM12/25/15
to Alexey Timofeyev, reverbrain
Hi Alexey

25.12.2015, 16:34, "Alexey Timofeyev" <timo...@playform.com>:
> Thank you for to realize the full implementation of Range headers. We will try to test in our cases.
>
> Now, when build from master I get this error:
>
> go build
> # _/root/go/src/github.com/bioothod/backrunner
> ./proxy.go:462: too many arguments in call to proxy.bctl.Stat

Looks like you haven't updated bucket/bctl.go to the latest sources.
Please update to the latest backrunner sources
Reply all
Reply to author
Forward
0 new messages