Extracting keyframes | Python | Opencv
问题 I am currently working on keyframe extraction from videos. Code : while success: success, currentFrame = vidcap.read() isDuplicate = False limit = count if count <= 10 else (count - 10) for img in xrange(limit, count): previusFrame = cv2.imread("%sframe-%d.png" % (outputDir, img)) try: difference = cv2.subtract(currentFrame, previusFrame) except: pass This gives me huge amounts of frames. Expected ouput: Calculate pixel difference between frames and then compare it with a threshold value and