문제

I was wondering why scikit-image returns the frame count of a video as a float. Is there ever an occasion when a video has a fractional number of frames?

This code snippet...

import skimage.io as io
v = io.Video('videos/intersection_cine.avi')
v.frame_count()

...returns 17313.0

도움이 되었습니까?

해결책

skimage.io.Video works by using OpenCV, and for frame_count it uses OpenCV's function GetCaptureProperty which always returns a double no matter what property is passed.

This function, in turn, calls another function based on how/where the video capture was created. As an example, it could be based on GStreamer, which will always return an integer for frame_count. When using QuickTime instead, frame_count is defined as movieDuration*movieFPS/1000 and therefore is a floating-point value.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top