-
Notifications
You must be signed in to change notification settings - Fork 293
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
[BUG] from_seconds/to_seconds & from_frames/to_frames do not produce matching values #1742
Comments
Not sure that closest is what is required. My first reaction is that we must be missing the bog standard add a half before rounding down somewhere. |
From an outsider’s point of view it’s about including frame 0 or starting from frame 1.Respectfully PhilPhil ***@***.***+1 (818)-746-6131Sent from my iPhoneOn Apr 17, 2024, at 12:09, Nick Porcino ***@***.***> wrote:
Not sure that closest is what is required. My first reaction is that we must be missing the bog standard add a half before rounding down somewhere.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@phil-man-git-hub Do you want to edit your message? I notice that your phone number has somehow got appended into the post. I'm afraid I am not following how a start of 0 or 1 helps me decide between rounding or closest, an example would help me out a lot. |
Sorry for the obtuse response.What I mean is that if you include frame 0 or time code 00:00:00:00, or 00:00:00;00, or 00:00:00+00 then your frame counts can be different than a count that starts on frame 1.So it’s not just about the calculation of out minus in divided by frame rate, but whether the calculation is inclusive or exclusive of frames.00:00:00+00 - 00:00:00+23 is either 23 frames long or 24 frames long.This can be complicated further when using key frames to denote value changes at temporal locations.e.g. If your animation curve starts at frame 1 but your timeline starts at frame 0 then which value is correct? Equally, if you are remapping frame 50 of your source to frame 25 on your timeline, do you count from frame one or from frame 0? (Both for the temporal location to change and the source blue to remap).There is definitely an opportunity to establish a rule here, but I expect it might be debated a bit.Thanks for the heads up about the phone number, although I can’t imagine that anyone might use or need it.Respectfully PhilPhil ***@***.*** from my iPhoneOn Apr 17, 2024, at 13:26, Nick Porcino ***@***.***> wrote:
@phil-man-git-hub Do you want to edit your message? I notice that your phone number has somehow got appended into the post.
I'm afraid I am not following how a start of 0 or 1 helps me decide between rounding or closest, an example would help me out a lot.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
That makes sense, thank you. The interfaces for to/from seconds/frames could be a little less simplistic to help with those cases. |
Required:
[X] I believe this isn't a duplicate topic
[X] This report is not related to an adapter
For adapter related issues, please go to the appropriate repository - likely in
the OpenTimelineIO github organization.
For general questions and help please use the
Academy Software Foundation slack,
#opentimelineio.
Select One:
[ ] Build problem
[X] Incorrect Functionality or bug
[ ] New feature or functionality
Description
Frames to Seconds conversion is not accurate on certain values at 25 FPS.
If I instance
RationalTime.from_frames
with a value of29
, when I callto_seconds()
it gives me1.16
.If I instance
RationalTime.from_seconds
with a value of1.16
, when I callto_frames()
it gives me28
.I believe this is due to the fact we always round down to nearest int rather than to closest int e.g the maths shows us it's just slightly below frame 29 and not at all close to frame 28:
This makes us unsure if we can trust OpenTimelineIO to always calculate correct values when converting between seconds/frames.
Optional
Environment
Operating System:
Python version if appropriate: Python 3.10.7
Reproduction Steps
Tested on v0.14.0, v0.15.0 & v0.16.0.
Example snippet:
The text was updated successfully, but these errors were encountered: