Skip to content
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

Get actual video frame number and time #3

Closed
rezgi opened this issue Aug 2, 2024 · 2 comments
Closed

Get actual video frame number and time #3

rezgi opened this issue Aug 2, 2024 · 2 comments

Comments

@rezgi
Copy link

rezgi commented Aug 2, 2024

Is your feature request related to a problem? Please describe (REQUIRED):
I need to get the ongoing decoded frame number and time in the video in order to assess if it's synced well with other game elements.

Describe the solution you'd like (REQUIRED):
have a getter method that returns the played frame number and time.

Describe alternatives you've considered (REQUIRED):
For now I'm burning the video frame number within the video itself in order to check but I need to access this data for more precise gameplay.

@britzl
Copy link
Contributor

britzl commented Aug 4, 2024

I don't see anything in the API (https://github.com/defold/extension-videoplayer-mpeg/blob/master/mpeg/src/pl_mpeg.h) to return the frame number. You can get the current time, and perhaps from that make some kind of assumption about frame number (if you know the frame rate)

print(mpeg.get_info().time) -- seconds (number)

@rezgi
Copy link
Author

rezgi commented Aug 4, 2024

I don't see anything in the API (https://github.com/defold/extension-videoplayer-mpeg/blob/master/mpeg/src/pl_mpeg.h) to return the frame number. You can get the current time, and perhaps from that make some kind of assumption about frame number (if you know the frame rate)

print(mpeg.get_info().time) -- seconds (number)

Getting the current time is more than enough, converting to framerate won't be a problem. Is that time() getter new or did I miss it? Didn't read it in the api file. Thanks

@britzl britzl closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants