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_frame fails if not an early frame #1052

Closed
tbenst opened this issue Dec 19, 2019 · 1 comment
Closed

get_frame fails if not an early frame #1052

tbenst opened this issue Dec 19, 2019 · 1 comment

Comments

@tbenst
Copy link

tbenst commented Dec 19, 2019

Expected Behavior

I can iter_frames with no issue, but get_frame does not work for large values:

video = mpy.VideoFileClip("vid.mp4")
np_frame0 = video.get_frame(324) # error
np_frame0 = video.get_frame(323) # ok
np_frame0 = video.get_frame(324) # ok

The error is SError: MoviePy error: failed to read the first frame of video file /data/deeplabcut_projects/Tail-suspension-Matt Wright-2019-11-09/videos/5475.vglut3.chr2.tst.half.second.stimDLC_resnet50_Tail-suspensionNov9shuffle1_5000_labeled.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website.

Note that I can "rescue" the error by not seeking too far into the future. If I choose 324 in the future I get an error, but 323 is ok, and subsequently I can grab 324.

@tbenst
Copy link
Author

tbenst commented Dec 19, 2019

this was a user error: I think I was going past length of video as this is in time, not frame index

@tbenst tbenst closed this as completed Dec 19, 2019
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

1 participant