I'm trying to access my IP camera stream in Python.
Camera: Xiaomi Mi Home Security Camera 360° 1080p
I got the IP address of the camera from the Mi Home app: 192.168.2.94
import cv2
cap = cv2.VideoCapture('http://192.168.2.94')
while True:
r, f = cap.read()
cv2.imshow('IP Camera stream',f)
I'm getting the following error:
Traceback (most recent call last):
File "<pyshell#60>", line 4, in <module>
cv2.imshow('IP Camera stream',f)
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
Can you please help?