Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

problem in cv::capture

Hello, I have a problem in project visual studio 2015 opencv 3.2 Same code code works without any problem in opencv 2.4

void Example_video1()
{
    //const std::string videoStreamAddress = "http://<username:password>@<ip_address>/video.cgi?.mjpg";
    const std::string videoStreamAddress = "http://<username:password>@<ip_address>/video.cgi?.mjpg";

    cv::namedWindow("Example3", cv::WINDOW_AUTOSIZE);

    cv::VideoCapture cap;
    cap.open(string("c:\\one.mp4"));



    //cout << frame .total()<< endl;
    int i = 1;
    Mat frame;
    for (;;)
    {


        cap >> frame; // get a new frame from file

        //cap.read(frame);
        if (frame.empty())
        {
            cout << "Empty" << endl;
            break;
        }
        else
            cout << "Frame: " << i << endl;
        i++;
        imshow("Example3", frame);
        if (waitKey(30) >= 0) break;


    }

    waitKey(0);
}

i get this exception in this line cap >> frame; // get a new frame from file Exception thrown at 0x00007FF8004368D8 in ConsoleApplication2.exe: Microsoft C++ exception: cv::Exception at memory location 0x000000ABBB00EA40.

Kindly advice