python调用网络摄像机

一个不知道啥牌子的网络摄像机

import cv2

url = 'rtsp://admin:admin@ip:554/h264/ch1/main/av_stream'
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()
url = 'rtsp://(用户名)admin:(密码)admin@ip:(端口)554/h264/ch1/main/av_stream'
具体格式介绍:https://jingyan.baidu.com/article/295430f19b01bf0c7e0050d2.html
原文地址:https://www.cnblogs.com/Triw/p/9799751.html