kyamagu / mexopencv

Collection and a development kit of matlab mex functions for OpenCV library
http://kyamagu.github.io/mexopencv
Other
664 stars 319 forks source link

Trouble reading RTSP feed with OPENCV #156

Open sbowman487 opened 9 years ago

sbowman487 commented 9 years ago

I'm trying to capture images from an rtsp feed but keep getting an empty output. I've had success using the below test link:

rtsp://quicktime.uvm.edu:1554/waw/wdi05hs2b.mov

But when I try my own link (below) it keeps returning empty arrays.

rtsp://admin:admin@192.168.1.6:554/cam/realmonitor?channel=1&subtype=0

I am able to use VLC to capture the stream from my link but unable to re-stream it to MATLAB. Any help would be greatly appreciated.

sbowman487 commented 9 years ago

Update: I am now able to re-stream the feed from VLC and read it by MATLAB, but it is very slow. Still looking for a way to directly read the rtsp feed in MATLAB with OpenCV VideoCapture function. My current attempted code is below.

Camera = cv.VideoCapture('rtsp://admin:admin@192.168.1.6:554/cam/realmonitor?channel=1&subtype=0');
pause(1);
Im = Camera.read;
imshow(Im);
kyamagu commented 9 years ago

@sbowman487 I am not sure the reason here, but this could be due to OpenCV itself. I would suggest you try the same thing using C++ (not Matlab) first and see if it works.