-
Notifications
You must be signed in to change notification settings - Fork 447
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
currentTime and video playback time are inconsistent #2535
Labels
bug
Something isn't working
Comments
is this issue Android only? |
Unfortunately, I can only provide information for Android, since I don't have an iPhone to test this. Sorry! |
We have roughly a similar use case and tested it on a physical Apple device (Ipad as well as IPhone). On these devices, the problem also occurs. Is there any new information/progress on this issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Hello everybody,
first of all, big thank you for adding Video support to Skia!
I've noticed a small discrepancy in the
currenTime
reported byuseVideo
and the actual playback time of the video. There appears to be a small offset of 2 - 3 frames or in my case when testing with a 30 fps video of 66 milliseconds (see Pciture 1 below). Interestingly this offset changes between subsequent loops of the video (see Picture 3 below). It also appears that the last frames are not displayed, since the currentTime is larger than the video time (10 seconds vs. 9.93 seconds, see Picture 2 below). Maybe this could be related to #2493? Additionally, I've noticed that the discrepancy is quite a bit larger when loading the video from an url vs loading it from the assets (66 milliseconds when loading from assets, 150 milliseconds when loading from url). This offset appears to be consistent throughout the video playback.I want to use this approach to draw a dynamic overlay over the video, highlighting objects in the video. However, since the currentTime and video time are slightly out of sync, as a result, my highlighting moves slightly ahead of the video.
Thank you very much for your help!
P.s.: It's probably impossible to also retrieve the exact frame via
currentFrame
in addition to the currentTime, but might be a nice feature :)Version
1.3.8
Steps to reproduce
Create new blank expo project with typescript support (
yarn create expo-app --template
)Install necessaries dependencies (
expo-build-properties
to set minSdkVersion to 26,expo-asset
to load video from filesystem). Here are my exact dependencies.currentTime == videoTime
. Actual:currentTime > videoTime
Snack, code example, screenshot, or link to a repository
Example Video used in these tests: [Example Video](https://cloud.uni-konstanz.de/index.php/s/d4M2imiSbWiWHkY/download/test_video.mp4
When pausing the playback of the video, the currentTime (which is drawn as a text overlay) is 0.83 seconds, the timestamp in the video is 0.77 seconds)
It appears the last two frames are not being played, since the currentTime reached the limit of 10 seconds, but the video is only at 298 frames and 9.93 seconds.
After the video looped once, the currentTime and videoTime seem to be in sync, however sometimes the discrepancy was sometimes also 3 milliseconds.
The text was updated successfully, but these errors were encountered: