Skip to content

OpenCV debug mode VideoCapture with file is broken #2613

@patrikhuber

Description

@patrikhuber

I've installed OpenCV 3.4.0 from vcpkg with opencv[ffmpeg] (without ffmpeg, it doesn't work either).

In Release and RelWithDebInfo mode, both camera and reading from files (e.g. an .avi file) is fine.
In Debug mode however, reading from the camera works, but not reading from the avi file.

    std::string inputvideo("vid.avi)";
    cv::VideoCapture cap;
    if (inputvideo.empty()) {
        cap.open(0); // no file given, open the default camera
    }
    else {
        cap.open(inputvideo);
    }
    if (!cap.isOpened()) {
        std::cout << "Couldn't open the given file or camera 0." << std::endl;
        return EXIT_FAILURE;
    }

cap.isOpened() fails in this scenario.

The problem also does not occur if I build OpenCV by myself (outside of vcpkg) and also not with the binary package from opencv.org.
It also occured on OpenCV 3.3.x in vcpkg.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions