I am using two HIKVISION IP camera (DS-2CD204WFWD-I) & (DS-2CD214WFWD-I) connected with (DS-7600 Series) NVR. Now how to acess these camera using Opencv and python ?
I had already tried this method its not working and code is running and its not getting the frame. With NVR software camera is showing live streaming and in andoird app also but i am not getting any frames with python. so please help me how can i acess these camera using opencv for face recognition.
import numpy as np
import cv2
cap = cv2.VideoCapture()
cap.open("rtsp://yourusername:[email protected]:555/
Streaming/channels/2/")
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame',ret)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
I expect both camera should be open using opencv.
Hm, usual addresses are:
Primary channel: rtsp://yourusername:[email protected]:555/ Streaming/Channels/101
Second channel: rtsp://yourusername:[email protected]:555/ Streaming/Channels/102