python_video_stab icon indicating copy to clipboard operation
python_video_stab copied to clipboard

ValueError: arr.shape[0] cannot be less than n

Open flixmk opened this issue 2 years ago • 1 comments

What does this mean : ValueError: arr.shape[0] cannot be less than n

and how can i fix it?

stabilizer = VidStab() stabilizer.stabilize(input_path='video_1.avi', output_path='stable_video.avi')

Error occurs when stabilizing. Wont work on .avi or .mp4. Video is RGB

flixmk avatar Jan 11 '22 19:01 flixmk

@Kraufel does your video happen to be fairly short? That error comes when a bigger smoothing window is used than there are frames available. Try setting the smoothing_window parameter of stabilizer.stabilize() to something lower than the default of 30.

AdamSpannbauer avatar Jan 11 '22 21:01 AdamSpannbauer