Connect the Hikvision camera to the computer with a network cable; (or use a switch, under a switch)
The default ip of Hikvision camera is 192.168.1.64
Effect: the same effect as through the URL of the Hikvision camera
rtsp://username:password@ip address/Streaming/Channels/2
import cv2
url = "rtsp://admin:[email protected]/Streaming/Channels/2"
cap = cv2.VideoCapture(url)
ret, frame = cap.read()
while ret:
ret, frame = cap.read()
cv2.imshow("frame",frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
cap.release()