MJPEG stream fails to open in OpenCV 2.4

asked 2013-08-06 05:50:42 -0500

HiteshVaghani gravatar image

updated 2013-08-07 06:27:38 -0500

I am having an issue getting OpenCV 2.4 to capture from an MJPEG stream from a Raspberry Pi, I have checked the stream URL in a browser and it seems to be working fine, however when I try to open it in OpenCV it seems to hang when I attempt to open it (I get neither the error or success messages on the terminal).

cv::VideoCapture vcap; cv::Mat
raw_image;

const string videoStreamAddress =
"http://192.168.0.28:8080/?action=stream";

if(!vcap.open(videoStreamAddress)) {
    cout<<"Error opening video stream"<<endl;
    return -1; }

cout<<"Stream opened"<<endl;

I am using MJPEG-Streamer to provide the stream. The same code works fine when capturing form a RTSP video stream.

edit retag flag offensive close merge delete

Comments

i know, it sounds like vodoo, but try adding a dummy param, that hints at the mjpg content:

const string videoStreamAddress = "http://192.168.0.28:8080/?action=stream&type=mjpg";

berak gravatar imageberak ( 2013-08-06 05:52:54 -0500 )edit
1

Nope not working,,,,,

HiteshVaghani gravatar imageHiteshVaghani ( 2013-08-06 06:09:57 -0500 )edit