Capture a video stream

asked 2015-03-28 11:34:16 -0500

LBerger gravatar image

updated 2015-03-29 10:17:07 -0500

Hi I try to capture a video stream and I cannot opent it using opencv. First I have try this command (from ffmpeg) with success

ffplay "http://192.168.0.16/videostream.cgi?loginuse=admin&loginpas=123456"

with this message :

[mjpeg @ 0000000002bedb40] Format mjpeg detected only with low score of 25, misdetection possible! Input #0, mjpeg, from 'http://192.168.0.16:80/videostream.cgi?loginuse=admin&loginpas=123456': Duration: N/A, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg), 640x480, 25 tbr, 1200k tbn, 25 tbc [swscaler @ 000000000595be40] deprecated pixel format used, make sure you did set range correctly

second this command using vlc with success :

vlc "http://192.168.0.16/videostream.cgi?loginuse=admin&loginpas=123456"

and with no success using opencv (with WITH_FFMPEG=true in cmake) new cv::VideoCapture("http://192.168.0.16/videostream.cgi?loginuse=admin&loginpas=123456");

In debugging I can see file cannot be opened at line 201 of cap_ffmpeg.cpp :

    virtual bool open( const char* filename )
{
    icvInitFFMPEG::Init();
    close();

    if( !icvCreateFileCapture_FFMPEG_p )
        return false;
    ffmpegCapture = icvCreateFileCapture_FFMPEG_p( filename );  // ffmpegCapture =0 with my stream
    return ffmpegCapture != 0;
}

I have check my program with web stream like http://xxxxxxxxx.axiscam.net:8010/mjp... and it works. So where is my mistake? How can I open this stream? Thanks for yours answers

edit retag flag offensive close merge delete