Reputation: 89
I have compiled an object deteection system using TensorFlow on a Windows 10 Machine, using Python 3.6. The model works with my Web Cam as well as a video stored on my PC.
I have attemped to get a feed from an IP CCTV camera as below:
cap = cv2.VideoCapture("http://username:password@camera ip")
This results in the error:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Could someone please guide me in the right direction.
Upvotes: 0
Views: 689
Reputation: 41
usually the cctv camera support rtsp protocol, you should wirte the code like this:
import cv2
cap = cv2.VideoCapture('rtsp://admin:[email protected]:554')
while True:
ret, img = cap.read()
cv2.imshow('video output', img)
k = cv2.waitKey(10)& 0xff
if k == 27:
break
cap.release()
cv2.destroyAllWindows()
Upvotes: 1