1)下载configtool并安装
https://www.onlinedown.net/soft/1108284.htm
2)修改摄像机目标ip地址,使该地址的前三位与电脑主机ip一致,最后一位无所谓,至于子网掩码以及网关,与本机保持一致,其中子网掩码以及网关需要在cmd窗口里输入。搜索设置里相机的密码和用户名一定要正确。
ipconfig/all
3)在网页中输入修改好的ip地址,10.1.23.1,输入用户名密码即可进入界面
4)使用python来保存视频
import cv2
print("hello")
#video_stream_path = "rtsp://%s:%s@%s/cam/realmonitor?channel=%d&subtype=0" % (user, pwd, ip, channel) # dahua
cap = cv2.VideoCapture("rtsp://admin:12233@10.1.23.1/cam/realmonitor?channel=1&subtype=0")
fourcc = cv2.VideoWriter_fourcc(*'XVID')
outvideo = cv2.VideoWriter('output_video.avi',fourcc, 30.0, (1920,1080))
frame_num = 0
while(frame_num<200):
frame_num += 1
ret, frame = cap.read()
print(frame.shape)
outvideo.write(frame)
#cv2.imshow('frame',frame)
cap.release()
outvideo.release()
cv2.destroyAllWindows()