-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advanced Video Streaming aka HTTP Range Requests #10
Comments
An update on my progress. I have 206 partial responses somewhat working. I am now able to load a video player into the default Chrome video view and skip around. http range requests are made at any point in the video. The problem is that I now need to stream each partial request, because they could be over the ~3 MB limit. I'm hoping this won't be too hard. |
@lastmjs can you clarify if you are only working on streaming response data, or also on streaming request data? |
Only response data
…On Mon, Jan 17, 2022, 11:02 PM Paul Young ***@***.***> wrote:
@lastmjs <https://github.com/lastmjs> can you clarify if you are only
working on streaming *response* data, or also on streaming *request* data?
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVNFDYL3D74JRLR3ZQOQ6DUWTX5HANCNFSM5JLXIHOA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I realize that the scope of your work probably relates to the bounty, but it seems like we’ll also need to support streaming uploads as well. Otherwise, I think the size of the video and audio files involved would be limited by what can be uploaded. |
I believe one limitation here is the 2MB message size. |
Uploads are easily chunked by the client, as can be seen by dfx being able to upload large file sizes |
Right, but that means people need to use I think the code from the certified assets crate that For web-based apps that probably needs changes to the service worker as well. |
What I meant by that is it's easy enough to chunk even from a browser client when uploading. As I understand it the browser client would just need to do what dfx does, which is split the files to be uploaded into appropriate binary chunks and use the update functions on the asset canister. They wouldn't be able to do it all in one http request, but neither does dfx. And this should be possible on the browser, someone just needs to write the code. I've done something similar with my own file example (using a Sudograph canister). Changes to the asset canister shouldn't be absolutely necessary, but perhaps it would be preferable to implement streaming uploads. But Dfinity is working on increasing the ingress message size limit anyway. |
I’m thinking of the use case where an app is trying to (or limited to) make a regular HTTP upload without any special handling. It also fits into a category of things that could be moved upstream so that every one who wants to do that doesn’t need to implement the same thing. |
Yeah I agree that would be great. I think for now it might be best to move this functionality into the JS agent, and then arbitrary sized ingress messages I would hope will provide a true fix. |
Just ran into a major issue. I've deployed the canister to production and filled it with assets, but partial responses aren't working in production. I wonder if the boundary nodes are filtering out the response headers. I added the following response headers:
Is there some whitelist in the boundary nodes that needs to be edited? @roman-kashitsyn @nomeata |
More info in this forum post, @jplevyak has said he will talk to the team and see about getting this addressed: https://forum.dfinity.org/t/boundary-node-http-response-headers/10747 |
@lastmjs Hi!) My case
Sorry, maybe I misunderstood something in the question, but in my case the headers are returned and it will help :) |
Interesting, I wonder if the 206 status code is not supported then?
…On Wed, Feb 9, 2022, 4:59 PM Roman Belov ***@***.***> wrote:
@lastmjs <https://github.com/lastmjs> Hi!)
I am testing adding of custom headers (Accept-Ranges and Content-Range)
and see that headers are received in production
My case
- Hard-code headers in certified_assets canister [image: Снимок экрана
2022-02-10 в 01 51 04]
<https://user-images.githubusercontent.com/18343842/153303837-e638f135-e7dc-43b7-a401-f8d65a797b56.png>
- Deploy and open browser
- Make .raw. request for some asset [image: Снимок экрана 2022-02-10 в
01 54 06]
<https://user-images.githubusercontent.com/18343842/153304243-33e57141-014a-43e0-bd71-abb965b1e0bc.png>
- Get headers
Sorry, maybe I misunderstood something in the question, but in my case the
headers are returned and it will help :)
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVNFD4RC25AVZOZRPPACPLU2LWUPANCNFSM5JLXIHOA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sorry, I dont know. I just checked if additional headers are filtered or not for |
I can assume that in order to have a range streaming, you need to upgrade this place (for https://github.com/dfinity/icx-proxy/blob/6cee84ace323c846f670d2eefdd292aa1b986f08/src/main.rs#L279 |
Just a heads up, apparently I shouldn't have even tried to do this from the
canister. Not sure if there is a consensus on the best way to go about
this, but see this thread for more info:
https://forum.dfinity.org/t/boundary-node-http-response-headers/10747/9
…On Wed, Feb 9, 2022, 5:25 PM Roman Belov ***@***.***> wrote:
I can assume that in order to have a range streaming, needs to upgrade
this place
https://github.com/dfinity/icx-proxy/blob/6cee84ace323c846f670d2eefdd292aa1b986f08/src/main.rs#L279
At this place, the chunks are downloaded sequentially from the
certified_assets and possibly sent to the browser. I tried to do
something similar in service worker
https://github.com/dfinity/ic/pull/5/files#diff-868be50442ee1d9397fa6910d4627c7a0386365ace603123de7ae169ce2de2e4R220
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVNFD2ATQMZ2A3A54B2TZ3U2LZXFANCNFSM5JLXIHOA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@3cL1p5e7 I've done my own testing, and it looks like It looks like the boundary nodes are filtering out the |
I'm attempting to do the work to claim this bounty: https://twitter.com/dominic_w/status/1467144071449915395
It seems like implementing HTTP Range request functionality will achieve video streaming, and beyond that audio streaming and really any kind of file streaming. I'm not exactly sure what is in scope for this bounty, but I hope to receive guidance on what is acceptable along the way.
Tentatively I'll be following this guide: https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests
I'm not sure how much of it needs to be implemented, as some functionality might not be necessary to have excellent video streaming from most clients/browsers
Required functionality
Possibly optional
The text was updated successfully, but these errors were encountered: