-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DASH]Floating point error is equal or larger than 0.2 causing video not playable #383
Comments
Thanks for the report. We'll look into it. |
Another case which seems to be the same issue as above, is integers too big to be handled by Javascript's number type. We have a live stream setup where the segment timeline starts with e.g. t="14641133787680667". The number returned from parsing this number is 14641133787680668. This rounding error results in 404 errors when the segment URLs are composed from this offset. The big numbers in the manifest, is a result of a timescale of 10,000,000, combined with offsets similar to Unix timestamps. In other words, the number of seconds from Jan 1 1970, multiplied by 10 millions, is part of the segment URLs. We are told this can't be changed. We need a fairly quick workaround, and are considering rewriting Shaka's timeline number handling by integrating with a big integer library, like https://github.com/peterolson/BigInteger.js. @joeyparrish If you don't see a simpler solution, do you see any issues with this strategy? Performance might be one concern. |
We are not interested in a bigint library at this time. You are welcome to make modifications, of course, but that is not a change we would accept in a pull request. We only support integers as large as can be accurately represented in JavaScript. (After all, this is a JavaScript library.) I would much prefer to see encoders create content that is compatible with the web platform. There's no reason a manifest should need such a large timescale. I recommend you raise this issue with your encoder vendor. It should be easy to fix, I would imagine. I would be happy to help you discuss it with your encoder vendor. My email address can be found in CONTRIBUTORS. Thanks! |
Thanks for sharing the Shaka dev team's stance on this. Also, thank you for your offer to discuss it with the vendors. In the long run, we will definitely check these complicating factors out with the vendors of the stream infrastructure, and then I might get back to you for a common effort to sort it out. |
When the start time value at the timeline is large enough, the floating point error due to using binary to represent decimal in machine becomes so large that 0.2 may not be a big enough error buffer(the 0.2 comes from fillUriTemplate in shaka.dash.MpdUtils.). It causes the player fails to play the playlist.
Mpd sample:
http://pastebin.com/jjEDSX29
lib/dash/mpd_utils.js:
I first saw the error at lib/dash/segment_template.js:
Example:
start = 164615753.8606333, info.presentationTimeOffset = 0, info.timescale = 10000000, timeReplacement would sometimes be equal to 1646157538606333.2 and it should be 1646157538606333 so the error occurs.
The text was updated successfully, but these errors were encountered: