import cv2
import numpy as np

video = cv2.VideoCapture(r'pictures/pictures.mp4')

counter = 0
if video.isOpened():
    while True:
        ret, frame = video.read()
        if not ret:
            print("Video doesn't open")
            break

        x, y = np.where(np.all(frame==np.array([0,0,0]), axis=2))
        if len(x) + len(y) > 100000 and len(x) + len(y) < 110000:
            counter+=1
            print('mine')
        
        # cv2.namedWindow('videoFrame', cv2.WINDOW_NORMAL)
        # cv2.imshow('videoFrame', frame)
        # key = cv2.waitKey(0)
        # while key != ord('q'):
        #     cv2.destroyAllWindows()
    
video.release()
cv2.destroyAllWindows()
# 86
print(counter)
