Ask Your Question

Revision history [back]

Error when opening video stream from IP camera

I am trying to open video stream from IP camera using these simple commands:

VideoCapture vcap;
Mat image;
const string videoStreamAddress = "http://192.xxx.x.xx:88/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=xxx&pwd=xx";

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

When I run the code, however, this error shows:

warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:856)
warning: http://192.xxx.x.xx:88/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=xxx&pwd=xxx (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:857)

I use Windows 10, visual studio community 2017 (15.8.7), opencv 3.4.3. I install openCV based on this video: https://www.youtube.com/watch?v=M-VHaLHC4XI

The interesting thing is, the missing file specified by the error message is on different location than my openCV installation directory:

C:\opencv\sources\modules\videoio\src\cap_ffmpeg_impl.hpp

Moreover, the directory shown by error messages indicate that it is for linux, while I use windows. Is it possible that there is error when compiling the dll file? How do I fix this error? Thanks in advance