-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
moviepy returns empty frames if frames are not accessed strictly sequentially #2044
Comments
Following it down into the backend:
I'm looking at the logic here: But I find the existence of self.last_read and self.lastread as distinct variables to be puzzling. I'm guessing the bug is somewhere around there. |
It looks like, at least with our datafiles, any use of Found this by modifying moviepy/video/io/ffmpeg_reader.py to print out the commandline its building with various calls, and looking over the Something like:
(really providing anything at all, float or integer, with a first Without that initial I'm wondering if it might be better to remove the first |
I will follow up with the ffmpeg developers. |
This seems like an oversight in #1170, I tested locally and remaing the fields to all have the same name works correctly. There's also some cases where you can make the variables get out of sync depending on what order you call get_frames/read_frames. These variables were previously not underscore-prefixed, so one of my projects relies on the presence of |
The property `lastread` was renamed to `last_read` in Zulko#1170 however not all instances were changed. This leads to some cases where only one of the variables is updated, which can make detection of end-of-file more complicated than it used to be in MoviePy 1.x. Additionally, there are third-party projects which relied on the lastread property as it was never declared as private (e.g. no underscore prefix). To avoid breaking projects relying on this, we also provide a property with the old name for backwards compatibility. Related to Zulko#2044
Expected Behavior
See below - the handle to a video file should not start returning zeros. The video file we're using with this is here:
https://caiman.flatironinstitute.org/~neuro/caiman_downloadables/msCam13.avi
We found this while spotting the error in pims, using the moviepy backend, and eventually tracked it down to moviepy when considering directly using moviepy to avoid what we believed was a bug in pims, instead to find that it's actually a bug in moviepy.
Oddly, accessing frame 0 of the movie fixes the handle to the movie
Actual Behavior
Steps to Reproduce the Problem
Specifications
The text was updated successfully, but these errors were encountered: