We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5a9629 commit e3960b4Copy full SHA for e3960b4
poseinterface/clips.py
@@ -38,6 +38,14 @@ def extract_clip(
38
f"filename: {video_path.name}, fps: {video.fps}, shape: {video.shape}"
39
)
40
41
+ # Clamp duration if it exceeds the video length
42
+ if start_frame + duration > video.shape[0]:
43
+ duration = video.shape[0] - start_frame
44
+ logging.warning(
45
+ "Clip exceeds video length. "
46
+ f"Clamping duration to {duration} frames."
47
+ )
48
+
49
# Slice clip and save as mp4
50
clip = video[start_frame : start_frame + duration]
51
clip_path = (
0 commit comments