Hi i am trying to load mjpeg camera
Code is working perfect in opencv2.4
but when i try same code with opencv 3.2 and i get the below error
[mpjpeg @ 00000094198e87e0] Expected boundary '--' not found, instead found a li ne of 3 bytes
Please can you help
const std::string videoStreamAddress = "CAM_URL";
cv::setBreakOnError(true);
cv::namedWindow("Example3", cv::WINDOW_AUTOSIZE);
cv::VideoCapture cap;
cap.open(videoStreamAddress);
if (!cap.isOpened())
{
cout << "File is not opened!";
exit(-1);
}
//cout << frame .total()<< endl;
int i = 1;
Mat frame;
for (;;)
{
try {
cout << "showing next frame" << i << endl;
cap.read(frame);
//cap.read(frame);
if (frame.empty())
{
cout << "Empty" << endl;
break;
}
else
cout << "Frame: " << i << endl;
i++;
imshow("Example3", frame);
cout << "Frame showed" << i << endl;
char c = waitKey(30);//without this image won't be shown
if (c == 27) break;
//if (waitKey(30) >= 27) break; //exception
}
catch (...) { /* */
//cout << e.msg << endl; // output exception message
}
}
Regards Wael