unstable frame count

asked 2020-03-16 08:54:13 -0600

peratchi gravatar image

updated 2020-03-16 09:21:44 -0600

supra56 gravatar image

Hi, I am getting different frame count for the same video on different machines.

Video usedhttp://commondatastorage.googleapis.c...

Code used to find frame count:

import cv2
cap= cv2.VideoCapture("BigBuckBunny.mp4")
i=0
while(cap.isOpened()):
ret, frame = cap.read()
if ret == False:
break
i+=1
print(i)

Output on machine 1 14300

Output on machine 2 14308

System Information Machine 1 OpenCV = 4.1.1.26 OS = Ubuntu 18.04.4 LTS 16 Core / 32GB RAM [cv2.videoio_registry.getBackendName(b) for b in cv2.videoio_registry.getBackends()] ['FFMPEG', 'GSTREAMER', 'INTEL_MFX', 'V4L2', 'CV_IMAGES', 'CV_MJPEG'] cap.getBackendName() FFMPEG

Machine 2 OpenCV = 4.1.1.26 OS = Ubuntu 18.04.3 LTS 8 Core /16GB RAM [cv2.videoio_registry.getBackendName(b) for b in cv2.videoio_registry.getBackends()] ['FFMPEG', 'GSTREAMER', 'INTEL_MFX', 'V4L2', 'CV_IMAGES', 'CV_MJPEG'] cap.getBackendName() FFMPEG

frame count will vary depends on machines? please help me out.

edit retag flag offensive close merge delete

Comments

Used cv2.CAP_PROP_FRAME_COUNT

supra56 gravatar imagesupra56 ( 2020-03-16 09:26:31 -0600 )edit