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
Imagine a simple video with fps = 30 and duration = 5.
You open it in moviepy and subclip it to only 1 second. Its new duration is 1 and you cannot do (obviously) .get_frame(t = 1) because first available frame is get_frame(t = 0) and last one is get_frame(t = 0.9666666666666667). But now you decide to do a subclip again, to 2 seconds. The system allows it, and the new duration if you print it is 2, but you still cannot do get_frame(t = 1).
If the clip is already subclipped, I think you wouldn't be able to subclip to a larger one. Or, if possible, you should be able to obtain those new frames, because the duration is the new one.
Pseudocode below
video# video of 30 fps and 5sprint(video.duration) # it says 5video=video.subclipped(0, 1) # video of 30fps and 1sprint(video.duration) # it says 1video.get_frame(t=1) # raises Exceptionvideo=video.subclipped(0, 2) # video of 30fps and 2sprint(video.duration) # it says 2video.get_frame(t=1) # raises Exception
The text was updated successfully, but these errors were encountered:
Hi, I actually cannot reproduce the exception, for me provided the original video is long enough no exception is raised. Could you check the issue still exists, and if so provide your initial video file ?
I would agree though that subclipping outside of theoretical duration should probably raise an exception, I have made a PR (#2319) implementing this behaviour, but I would like some others maintainers (@Zulko and @keikoro) input on that. Should we consider subclipping as intentionally able to break the current clip boundaries, due to the nature of how moviepy handle start and end time (virtual, applied at render time, not previously), or should we consider this a misleading behaviour (I vote in favour of the last) and merge the PR ?
Imagine a simple video with
fps = 30
andduration = 5
.You open it in moviepy and subclip it to only 1 second. Its new duration is 1 and you cannot do (obviously)
.get_frame(t = 1)
because first available frame isget_frame(t = 0)
and last one isget_frame(t = 0.9666666666666667)
. But now you decide to do a subclip again, to 2 seconds. The system allows it, and the new duration if you print it is 2, but you still cannot doget_frame(t = 1)
.If the clip is already subclipped, I think you wouldn't be able to subclip to a larger one. Or, if possible, you should be able to obtain those new frames, because the duration is the new one.
Pseudocode below
The text was updated successfully, but these errors were encountered: