i am trying to design new system in openCV but not able to capture stream from IP camera.
I've tried using different protocol like rtsp and http.
import numpy as np
import cv2
cap = cv2.VideoCapture('http://root:[email protected]/mjpg/video.mjpg')
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(20) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
[tcp @ 0x7ff4d705c440] Connection to tcp://192.168.1.114:80 failed: Operation timed out OpenCV: Couldn't read video stream from file "http://root:[email protected]/mjpg/video.mjpg" Traceback (most recent call last): File "camera-test.py", line 14, in cv2.imshow('frame',frame) cv2.error: OpenCV(4.1.0) /tmp/opencv-20190505-12101-14vk1fh/opencv-4.1.0/modules/highgui/src/window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'