Access network video stream [closed]

asked 2016-03-08 09:39:38 -0600

LKM gravatar image

I have designed an algorithm to analyse streaming video from built in webcam and now I want to use the same algorithm to access network streamed video, but I don't know how to change the setting to do this.

Currently I use: video_capture = cv2.VideoCapture(0) and ret, frame = video_capture.read() to read the video frames from the webcam. Is there a way to do this from a stream such as: rtsp://192.168.240.1:5544/ph. I can access this stream in vlc.

I am using opencv3 and python 2.7.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-09-20 03:31:32.159391

Comments

try : video_capture = cv2.VideoCapture("rtsp://192.168.240.1:5544/ph")

berak gravatar imageberak ( 2016-03-09 03:59:37 -0600 )edit

Thanks for your response. Unfortunately I have already tried this, but I receive the message: Couldn't read movie file rtsp://192.168.240.1:5544/ph

LKM gravatar imageLKM ( 2016-03-09 04:58:05 -0600 )edit

unfortunately, you're at the mercy of ffmpeg / gstreamer now ;(

if you're on win, make sure, cv2.pyd finds opencv_ffmpeg310.dll (or whatever your version is)

berak gravatar imageberak ( 2016-03-09 05:03:23 -0600 )edit

Will either of these work with mac?

LKM gravatar imageLKM ( 2016-03-09 05:07:23 -0600 )edit