(编辑:jimmy 日期: 2024/11/13 浏览:2)
获取实时数据
import cv2 # user: admin # pwd: 12345 # main: 主码流 # ip: 192.168.1.64 # Channels: 实时数据 # 1: 通道 cap = cv2.VideoCapture("rtsp://admin:12345@192.168.1.64/main/Channels/1") print (cap.isOpened()) while cap.isOpened(): success,frame = cap.read() cv2.imshow("frame",frame) cv2.waitKey(1)
获取回放
import cv2 # user: admin # pwd: 12345 # main: 主码流 # ip: 192.168.1.64 # tracks: 回放 # 1: 通道 # time: 开始时间和结束时间的范围 time='starttime=20180613t172206z&endtime=20180613t172230z' cap = cv2.VideoCapture("rtsp://admin:12345@192.168.1.64:554/main/tracks/1" + time) print (cap.isOpened()) while cap.isOpened(): ret,frame = cap.read() cv2.imshow("frame",frame) cv2.waitKey(1)
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。