I'm trying to see my webcam feed using the open cv library. I am able to see my webcam feed when I go to https://192.168.1.214:80 on my browser, but when I try to look at it with Open CV I just get this:
error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
I know this essentially means there's no image to show, but I dont understand why?
here is my code:
import cv2
WEBCAM_IP = 'http://192.168.1.214:80'
video_capture = cv2.VideoCapture(WEBCAM_IP)
while True:
ok, frame = video_capture.read()
cv2.imshow('Video', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
I have tried connecting a separate camera and just referring to the file in the VideoCapture() arguments, I've tried writing the IP in different ways, I'm completely at a loss.