我正在尝试使用python opencv读取rtsp实时流,但出现以下错误
[rtsp @ 000001f610c828a0]方法设置失败:461客户端错误
警告:打开文件时出错(/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:856) 警告:rtsp://192.168.1.18:8554 / cam(/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:857)
cap = cv2.VideoCapture("rtsp://192.168.1.18:8554/cam",cv2.CAP_FFMPEG)
if cap.isOpened():
cv2.namedWindow("demo", cv2.WINDOW_AUTOSIZE)
while True:
ret_val, img = cap.read();
cv2.imshow('demo',img)
cv2.waitKey(10)
else:
print("camera open failed")
cv2.destroyAllWindows()
我正在使用python 3.5和opencv 3.4.2