AdamSpannbauer / python_video_stab

A Python package to stabilize videos using OpenCV
https://adamspannbauer.github.io/python_video_stab/html/index.html
MIT License
682 stars 118 forks source link

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

Open flixmk opened 2 years ago

flixmk commented 2 years ago

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

AdamSpannbauer commented 2 years ago

@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.