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

Stabilized video has fewer frames than original video #117

Open anirudh-chakravarthy opened 3 years ago

anirudh-chakravarthy commented 3 years ago

Hi,

I was planning to use this library to stabilize a video dataset before further processing. However, I observe that usually, the stabilized video (after filtering out the black frames) has fewer frames than the original video itself. Most commonly, it's 1 frame lesser, but I've also encountered a difference of 6-7 frames as well. I verified this observation on the ostrich video as well, where I see 1 frame fewer in the stabilized video.

Could you help me understand why this happens, and if there is a workaround to retain the number of frames? I use stabilize_frame on each frame in the input video. However, on using stabilize on the ostrich video, the number of frames returned are equal before and after stabilization. Why is this the case?

Thanks!