I have an ongoing project accessing multiple IP cameras through opencv VideoCapture, working for most of them.
I ve got a new Dahua PTZ camera that uses digest authentication, and the VideoCapture in OpenCV can't open it. Through WireShark i could see that the camera is returning a 401 Unaothorized.
I found nothing on OpenCV documentation about auth problems.
Maybe i need to use something else that is not OpenCV to solve this?
Here is a minimum working code (if you have a camera to test).
#include <iostream>
#include <imgproc.hpp>
#include <opencv.hpp>
#include <highgui.hpp>
using namespace std;
using namespace cv;
int main(){
while(1){
VideoCapture cap("http://login:password@111.111.111.111/cgi-bin/snapshot.cgi");
if(!cap.isOpened()){
cout << "bug" << endl;
continue;
}
Mat frame;
cap >> frame;
imshow("test", frame);
}
}
And here is the camera response: