When executing
cap = cv2.VideoCapture("vid.mp4")
while True:
ret, frame = cap.read()
(height, width) = frame.shape[:2] ###
print(height)
minimap = frame[1648:1920, 800:1080]
if cv2.waitKey(1) == 27:
exit(0)
I can see that for a few seconds, frame has a height and width but it suddently crashes due to the fact that "'NoneType' object has no attribute 'shape'" (on line with the ###). Any idea why ?