調用ip攝像頭本來好好的,然後莫名其妙報錯
cv2.namedWindow("camera", 2) # 開啟ip攝像頭 video = "http://admin:[email protected]:8081/" # 此處@後的ipv4 地址需要改為app提供的地址 cap = cv2.VideoCapture(video) # 開攝像頭 while True: ret, image_np = cap.read() cv2.imshow('camera', image_np) key = cv2.waitKey(10) # 按鍵處理 if key == 27: # esc鍵退出 print("esc break...") break print(cap.get(cv2.cv2.CAP_PROP_FRAME_COUNT)) cap.release() cv2.destroyAllWindows()