opencv实现网络摄像机rtsp拉流

import cv2

url = "rtsp://admin:password@ip:端口/type=0&id=1"

cap = cv2.VideoCapture(url)

while(cap.isOpened()):
    ret, frame = cap.read()
    cv2.imshow('frame',frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()

你可能感兴趣的:(opencv,计算机视觉,python)