Error when opening video stream from IP camera

asked 2018-10-25 02:20:18 -0600

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-VHa...

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

edit retag flag offensive close merge delete

Comments

the missing file specified by the error message is on different location than my openCV installation directory

the ffmpeg dll is build on some external bot, so the location of the code differs. ignore.

the problem is: it either does not understand your url, or it can't find anyting at http://192.xxx.x.xx:88/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=xxx&pwd=xxx

maybe cross-check with a webbrowser / vlc or similar ?

berak gravatar imageberak ( 2018-10-25 02:25:19 -0600 )edit

So the library is fine, just that the missing file is a false error message? Okay I will take a look further on the url. Thank you

ghifarahadian gravatar imageghifarahadian ( 2018-10-25 19:30:41 -0600 )edit