Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[idea],[proposal] Pseudo Blob (for video not getting stuck) #1014
Comments
This comment has been minimized.
This comment has been minimized.
|
I was telling @jhiesey about this issue and he just debugged for the last few hours and found a really subtle bug in That means that if the video writable has too much data it could apply backpressure and potentially starve the audio writable from the data it needs. Then the whole video tag will stall. We're now creating a file stream for each media track and the problem seems to be gone! New version of |
This comment has been minimized.
This comment has been minimized.
|
@kocoten1992 Also, thanks for the proposal, but I think we should fix this at the source. |
This comment has been minimized.
This comment has been minimized.
|
@feross glad to hear that, I thought this is about html5 video feature and can't be fix, let this issue live for a while longer, I'll test if |
This comment has been minimized.
This comment has been minimized.
|
Wonderful, it seem it really gone. Got a question, did I have to do anything other than: file.appendTo(rootElem, [opts], [function callback (err, elem) {}]) //(browser only)file.renderTo(elem, [opts], [function callback (err, elem) {}]) //(browser only)Cause, when looking around I saw no |
This comment has been minimized.
This comment has been minimized.
|
Yes, that's all you need to do. We depend on
|
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
What is it? Why?
Let's me give a demo:
1. Video webtorrent: https://www.youtube.com/watch?v=M-ClDIiDm9Y
Sometime it will stall (happen much when seek very far distant on a long video), even when video have been fully download (129/129 MB).
2. Everything was in blob: https://www.youtube.com/watch?v=QXNXp2Fr7XM
Seeking work flawlessly, Blob will allocate a block of data on your memory, result in very fast seeking.
Currently there is
and
But both required when the file have been fully download, meaning I can't use that api for blobURL for video as soon as I want, then I would like to proposal pseudoBlob.
Mind this (got cha)
Because Blob will allocate in memory, we need to carefully treat it especially at large video (2GB or up), have a read at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management
We can trick
garbage collectorto delete what we don't want anymore (It might not immediately release memory, but after some seconds (0-5s), generally it work, but consider this some seconds factor).Proposal
Before spending lots of time on something, ask for feedback on your idea first!Thing might not work, but here is my proposal:
-We will create pseudoBlob base on torrent's file size.
-When more data come, we slice and recompute the pseudoBlob.
-At any given time, we can provide user a getPseudoBlob and getPseudoBlobURL.
-When the file is fully download pseudoBlob will become true Blob.
When seeking video on pseudoBlob, if data haven't download yet, it will jump to to the closet valid data, and because it is blob, video will not getting stuck :). What do you think about this?