It had to happen, I'm stuck in the last phase of my project, when I want to use my code which works like a charm on my webcam, on an IP camera. The URL works perfectly in my browser, but nothing comes out with OpenCV... Here is my code:
#include <opencv/highgui.h>
using namespace cv;
int main(int argc, char *argv[])
{
Mat frame;
namedWindow("video", 1);
VideoCapture cap("http://192.168.1.99:99/videostream.cgi?resolution=32&rate=0&user=admin&pwd=password&.mjpg");
while ( cap.isOpened() )
{
cap >> frame;
if(frame.empty()) break;
imshow("video", frame);
if(waitKey(30) >= 0) break;
}
return 0;
}
And the compiler settings :
//Added to the .pro file of QtCreator
INCLUDEPATH += C:\\OpenCV243\\release\\include
LIBS += -LC:\\OpenCV243\\release\\lib \
-lopencv_core243.dll \
-lopencv_highgui243.dll
I read somewhere that OpenCV had to be compiled with FFMPEG support (please confirm this is the true reason it doesn't work), but I thought version 2.4.3. was ? Also, I don't have FFMPEG libraries installed yet, but the linker doesn't seem to bother. Should I deduce that I can't just install FFMPEG the standard way (compile, then put bin in PATH, and link projects with ffmpeg libraries) ? What should I do ?
Thanks for your help,
Regards, Mister Mystère