OpenCV VideoCapture doesn't work inside Visual Studio 2017 (Windows 10)
I have a very strange problem. VideoCapture do not open nor webcam nor video file when I run the C++ application from Visual Studio and in the case of webcam gives me the following error:
WinRT originate error - 0xC00D36B3 : 'The stream number provided was invalid.'
followed by
Microsoft C++ exception: _com_error at memory location 0x000000D9B66FCBB0. Microsoft C++ exception: _com_error at memory location 0x000000D9B66FCAA0. Microsoft C++ exception: cv::Exception at memory location 0x000000D9B66FEFD0. Microsoft C++ exception: cv::Exception at memory location 0x000000D9B66FEFD0.
But when I run the app from outside VS - everything work. I use OpenCV 4.0.0
the prebuilt libs are not meant to be used with WinRT. try to use an EMPTY project with VisualStudio iinstead.
What is interesting - I don’t use WinRT. Actually, I created an empty “Console Application” project.