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()

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐