Cap.cpp (265). cv::VideoCapture::open VIDEOIO(DSHOW): raised unknown C++ exception

Hello.

I am getting this error sporadically:

[ERROR:1] global …\src\cap.cpp (265) cv::VideoCapture::open VIDEOIO(DSHOW): raised unknown C++ exception!

The app that rases this exception is a python script that takes periodic pictures using a usb connected camera. The script works fine, but SOMETIMES it gives that error and crashes.

what is exactly the error (265)? can some changes be made to opencv to handle better that problem?

265 is not an error code but line number

error is thrown here

you would help yourself immensely by posting all relevant information. ask yourself why you didn’t post that script you mentioned

if at all possible, reduce the problem to a minimal reproducible example. we don’t need to see code that doesn’t contribute to the issue.