Hi,
I want show ipcamear stream using opencv 4 & python 3.7 .but i am getting the below error.
arning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901) warning: rtsp://ipaddress/Streaming/Channels/1 (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902) Traceback (most recent call last):
Code :
import the necessary packages
from imutils.video import VideoStream import numpy as npq import argparse import imutils import time import cv2 import os
print("[INFO] starting video stream...") vs = cv2.VideoCapture("rtsp://ipcamera/Streaming/Channels/1")
loop over the frames from the video stream
count =0.0
while True:
# print(count)
count += 1
ret, frame = vs.read()
frame = imutils.resize(frame,width=740)
cv2.startWindowThread()
cv2.imshow('Stream IP Camera OpenCV',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
vs.release() cv2.destroyAllWindows()