You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bzczb opened this issue
Feb 14, 2024
· 0 comments
· May be fixed by #2117
Labels
bugIssues that report (apparent) bugs.lib-FFmpegIssues pertaining to dependency FFmpeg.videoRelated to VideoClip and related classes, or handling of video in general.
moviepy largely treats "get the frame at time x" as shorthand for "get the frame displayed at time x", so "get the frame at time 0.00001" should mean "get frame 0". But ffmpeg treats "get the frame at time x" as "skip all frames until reaching time x", so sometimes clip.make_frame(0.00001) will return frame 1, and sometimes it will return frame 0, depending on what's been cached in last_read.
Steps to Reproduce the Problem
Load a video clip which has a different image every frame. (Some clips will have the same image for multiple consecutive frames, which will make it seem like it works correctly)
test_unusual_order_frame_pos() in test/test_ffmpeg_reader.py is insufficient to detect this bug, as the test video used runs at 1 frame per second exactly. The inconsistency between "moviepy seek" and "ffmpeg seek" does not appear if the timestamps of all frames can be represented exactly in decimal!
The text was updated successfully, but these errors were encountered:
keikoro
added
lib-FFmpeg
Issues pertaining to dependency FFmpeg.
video
Related to VideoClip and related classes, or handling of video in general.
labels
Feb 14, 2024
bugIssues that report (apparent) bugs.lib-FFmpegIssues pertaining to dependency FFmpeg.videoRelated to VideoClip and related classes, or handling of video in general.
Expected Behavior
clip.make_frame(0)
returns frame 0,clip.make_frame(1 / clip.fps)
returns frame 1,clip.make_frame(2 / clip.fps)
returns frame 2, etc.Actual Behavior
moviepy largely treats "get the frame at time x" as shorthand for "get the frame displayed at time x", so "get the frame at time 0.00001" should mean "get frame 0". But ffmpeg treats "get the frame at time x" as "skip all frames until reaching time x", so sometimes
clip.make_frame(0.00001)
will return frame 1, and sometimes it will return frame 0, depending on what's been cached inlast_read
.Steps to Reproduce the Problem
Load a video clip which has a different image every frame. (Some clips will have the same image for multiple consecutive frames, which will make it seem like it works correctly)
Here is a clip you can use:
colorbars.mp4
Specifications
Testing note
test_unusual_order_frame_pos()
intest/test_ffmpeg_reader.py
is insufficient to detect this bug, as the test video used runs at 1 frame per second exactly. The inconsistency between "moviepy seek" and "ffmpeg seek" does not appear if the timestamps of all frames can be represented exactly in decimal!The text was updated successfully, but these errors were encountered: