I want to stream the video from IP camera by using RTSP. But I am having a problem. I have installed prerequirements and also, my RTSP link works on VlC player. But when I tried it in the editor and run it, it says Camera could not be found.
Here is my code.
import cv2
import numpy as np
cap = cv2.VideoCapture("rtsp://admin:admin@xxx.xxx.xxx.xxx:xxx/media/video1/video")
while True:
ret, img = cap.read()
if ret == True:
cv2.imshow('video output', img)
k = cv2.waitKey(10)& 0xff
if k == 27:
break
cap.release()
cv2.destroyAllWindows()