-
Notifications
You must be signed in to change notification settings - Fork 33
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
Do we need to accurately represent non-integer frame rates ? #12
Comments
I'd say Yes. We frequently deliver video content which is best expressed in this manner. Otherwise, a common use case might be:
It'd be nice not to have to convert for the MediaCapabilities API |
I'm flexible on how we represent it. Internally this will probably be represented as floating point either way. Maybe even rounded to the nearest integer. Our answers for smoothness capabilities likely wont change based on small differences in fractional fps. |
@geneticgenesis there is no API I'm aware of on the Web Platform that will take input such as "24000/1001". As @chcunningham mentioned, this would be converted to a Allowing to pass something else than a |
You don't need a new type, just two integers or an enumeration (which you could take from MPEG Codec Independent Code Points as has been done for the VP9 codec string values). There isn't a problem for simple queries, but I worry about people mistakenly relying on the value they read back from this attribute because, for example, 24000 / 1001 != 23.967. Suppose you want to filter an array of MediaCapabilities objects - you need to be consistent about whether you are using exact (24000 / 1001) or approximate (23.967) frame rates. This could be a source of error, especially if you are using some third party library and you need to be consistent with what that does. |
You seem to assume that implementations will return different values for 23.9, 23.967 and 24. Is there a specific reason that makes you think this? Does DASH allows for framerate expressed like this? |
I'm not sure how DASH represents frame rate. I'm thinking of the case where a user creates a So, the problem is that the attribute is set to, say, (24000/1001) and later someone tries to compare it to 23.967. They are not equal, but the same frame rate is intended. |
I would be surprised if an implementation returns a different value for 23.967 and 24. I'm happy to add a note in the specification for implementation to consider this rounding error case. Would that resolve your concern? |
The problem is that 24000 / 1001 != 23.967 either mathematically or as a JavaScript statement. |
I think we should fix this indeed. I propose to match the DASH manifest specification and take a |
This has landed as part of #51. Closing. |
FYI, latest resolution discussion on this issue moved to |
Non-integer frame rates, such as 24000/1001, are common and aren't precisely representable in binary floating point. Typically, video frame rates are specified as rational numbers or with an enumeration (or both).
We should discuss whether we need to accurately represent the non-integer rates for this API.
The text was updated successfully, but these errors were encountered: