调用ip摄像头本来好好的,然后莫名其妙报错
cv2.namedWindow("camera", 2)
# 开启ip摄像头
video = "http://admin:admin@10.22.57.132: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()