Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from __future__ import division
- import cv2
- import numpy as np
- import matplotlib.pyplot as plt
- import hikvision.api
- import time
- # cap = cv2.VideoCapture("rtsp://admin:192.168.1.64@10.162.1.49")
- cap = cv2.VideoCapture("rtsp://admin:admin@10.12.4.115/1/h264minor")
- # fgbg = cv2.createBackgroundSubtractorMOG2()
- cam = hikvision.api.CreateDevice('192.168.2.5', username='admin', password='admin')
- to_change = True
- if __name__ == '__main__':
- i =0
- start_time = time.time()
- while True:
- i += 1
- current_time = time.time()
- if current_time - start_time > 5:
- if to_change:
- # Do
- response = cam.System.deviceInfo(method='get')
- print(response)
- to_change = False
- ret, img = cap.read()
- # print ret
- cv2.imshow('original', img)
- if cv2.waitKey(1)>0:
- break
- cv2.destroyAllWindows()
Add Comment
Please, Sign In to add comment