It was about to happen, I was stuck at the last stage 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 fine in my browser, but nothing works 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 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 tested opening the .avi file with the same code and it works ... But the regular IP camera URL, such as http://66.184.211.231/mjpg/video.mjpg , does not work! What then happens?
Deleted by editing: I considered FFMPEG a problem, but v2.4.3. has native support for FFMPEG and .avi files, although I don't have the FFMPEG library installed (need to be explained?)
Thanks in advance,
Regards, Mr Mr
source share