while True: ret, frame = cap.read() if not ret: break