You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am using this equation Math.floor(to.query().position * 20) to get the current frame number from a video.
The problem is that the position is not an integer number so I sometimes get the previous frame.
I know that the position, in this case, represents the currentTime of the video (which is a float number) that why I'm getting this error.
Is there a way to make the position in the TimingObject to represent the frame number?
The text was updated successfully, but these errors were encountered:
Keep in mind that the Timing Object represents a logical timeline linked to a clock (e.g. performance.now()), whereas the timeline of the video (e.g. frame numbers) is a bit more wiggly in playback. Even if you sync the video to the timing object - the diff will likely be non-zero at any time. So - during playback you should regard your timing object as an approximation of the video offset - or vice versa.
Also
there are no integer type in Javascript - numbers are all floats
from your equation: are you sure the framerate is 20? 24 or 25 are much more common values
Hello,
I am using this equation
Math.floor(to.query().position * 20)
to get the current frame number from a video.The problem is that the position is not an integer number so I sometimes get the previous frame.
I know that the position, in this case, represents the currentTime of the video (which is a float number) that why I'm getting this error.
Is there a way to make the position in the TimingObject to represent the frame number?
The text was updated successfully, but these errors were encountered: