Try -catch failure

I am pretty sure cap.isOpened() doesn’t throw exceptions. I am not even sure the cv::VideoCapture constructor does. When you run in debug what are the exception details printed to the cmd window/terminal?