-
Notifications
You must be signed in to change notification settings - Fork 354
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
incorrect frame.time due to use of codec_time_base #319
Comments
Thank you for looking into this so thoroughly. This needs a good sit and read along with my time overview. I hope to do that in the near future. If you keep digging into it please let me know how the rules need adjusting. |
I ran into the same issue, and using the stream's time_base seems to yield the correct presentation time as in:
I'll have a look at the code and submit a PR |
I'm pretty sure this was fixed in f2425f6. |
Ah sorry, I was using the version on pypi, I'll give master a try. |
No apologies will be accepted for this 😛 . This is a horribly complex project IMO with tons of fixes and tiny features left dangling in branches forever. |
System: Linux, ffmpeg 3.3.6, PyAV from git (last commit on April 10)
Was using PyAV to iterate through a 25 FPS video and found frame1's .pts is 0 and .time is 0.0. All good. But then frame2's .pts is 40 and .time is 1.6 (instead of 0.04). Hm...
av/frame.pyx:
That looks fine, but Frame._time_base is evidently set to 1/25, not the 1/1000 it should be (in this case). Using ffprobe terminology, it's calculating time using the stream's codec_time_base instead of the stream's time_base.
Was curious, so then I looked at all the time-related values from ffprobe and tried to match them up w/ values from PyAV. Run these cmds:
(Note that the 2nd cmd grabs the 2nd frame's values, since the 1st frame has mostly 0s.) Output is:
Then, in a python console:
Output is:
Some differences between ffprobe and PyAV:
The text was updated successfully, but these errors were encountered: