Skip to content

Conversation

@Britefury
Copy link
Contributor

@Britefury Britefury commented Aug 10, 2020

pyav_reader._gen_frames sometimes yields frame objects with incorrect frame numbers due to incorrect rounding.
Fixed by using round rather than int.
This has resulted in PyAVTimedReader.get_frame returning frame objects whose frame_no field has a different frame than the value passed to get_frame.
I was able to confirm this on a video file and verify that PyAVTimedReader and PyAVIndexedReader return different frames when randomly seeking. Furthermore, converting the video to a sequence of PNGs using ffmpeg and reading those agrees with PyAVIndexedReader but not PyAVTimedReader. This fix addresses this, resulting in PyAVTimedReader returning frame consistency with the others.
I may be able to release the video file for testing, but will have to check.

…d to nearest rather than `int` to round down.
@Britefury Britefury force-pushed the pyav-gen_frames-rounding branch from 7afd709 to 615e833 Compare March 10, 2021 16:02
@Britefury
Copy link
Contributor Author

Re-based onto master (as of 2021/Mar/10) and fixed bugs that were preventing tests from passing.
(the fix was to wrap the round call in an int type cast).

@nkeim nkeim merged commit 68c560e into soft-matter:master Mar 13, 2021
@nkeim
Copy link
Contributor

nkeim commented Mar 13, 2021

Thank you @Britefury for tracking down this edge case, and thanks for the rebase!

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

Successfully merging this pull request may close these issues.

2 participants