<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.4.2</li>
<li>Operating System / Platform =&gt; Windows 64 Bit</li>
<li>Compiler =&gt; Visual Studio 2015</li>
<li>Python =&gt; Python 3.6 (64-bit)</li>
</ul>
<p dir="auto"><a href="https://github.com/opencv/opencv/files/2303118/bi.txt">BuildInformation.txt</a></p>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I have only one camera connected to my pc. When I try to connect to it and grab a frame (code example 1), I end up with an error after a 10 second time out. Coincidentally, I found, that I am able to connect to my camera by using index -1 for cv2.VideoCapture(index), see code example 2.</p>
<p dir="auto">As cv2.VideoCapture(index) is initilized by an index, I'd suppose this index would start with 0.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Python Code example 1 (returns error)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import cv2

cap = cv2.VideoCapture(0)
_, frame = cap.read()"><pre class="notranslate"><code class="notranslate">import cv2

cap = cv2.VideoCapture(0)
_, frame = cap.read()
</code></pre></div>
<p dir="auto">returning output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ WARN:0] videoio(MSMF): can't grab frame. Error: -2147483638
Traceback (most recent call last): File &quot;D:\...\Test1.py&quot;, line 10, in &lt;module&gt; hsvFrame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) cv2.error: OpenCV(3.4.2) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) &amp;&amp; VDcn::contains(dcn) &amp;&amp; VDepth::contains(depth) in function 'cv::CvtHelper&lt;struct cv::Set&lt;3,4,-1&gt;,struct cv::Set&lt;3,-1,-1&gt;,struct cv::Set&lt;0,5,-1&gt;,2&gt;::CvtHelper'"><pre class="notranslate"><code class="notranslate">[ WARN:0] videoio(MSMF): can't grab frame. Error: -2147483638
Traceback (most recent call last): File "D:\...\Test1.py", line 10, in &lt;module&gt; hsvFrame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) cv2.error: OpenCV(3.4.2) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) &amp;&amp; VDcn::contains(dcn) &amp;&amp; VDepth::contains(depth) in function 'cv::CvtHelper&lt;struct cv::Set&lt;3,4,-1&gt;,struct cv::Set&lt;3,-1,-1&gt;,struct cv::Set&lt;0,5,-1&gt;,2&gt;::CvtHelper'
</code></pre></div>
<p dir="auto">Python Code example 2 (works)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import cv2

cap = cv2.VideoCapture(-1)
_, frame = cap.read()"><pre class="notranslate"><code class="notranslate">import cv2

cap = cv2.VideoCapture(-1)
_, frame = cap.read()
</code></pre></div>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.2,0</li>
<li>Operating System / Platform =&gt;Windows 64 Bit</li>
<li>Compiler =&gt; mingw32</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">Hello I am installing opencv in QT as mention below link :<br>
<a href="https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows" rel="nofollow">https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows</a></p>
<p dir="auto">During below step :<br>
d:<br>
cd d:<br>
cd opencv-build<br>
mingw32-make -j 8<br>
mingw32-make install</p>
<p dir="auto">Brief part</p>
<p dir="auto">collect2.exe: error: ld returned 1 exit status<br>
modules\highgui\CMakeFiles\opencv_highgui.dir\build.make:202: recipe for target 'bin/libopencv_highgui320.dll' failed<br>
mingw32-make[2]: *** [bin/libopencv_highgui320.dll] Error 1<br>
CMakeFiles\Makefile2:4399: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed<br>
mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2<br>
Makefile:159: recipe for target 'all' failed<br>
mingw32-make: *** [all] Error 2<br>
collect2.exe: error: ld returned 1 exit status<br>
modules\highgui\CMakeFiles\opencv_highgui.dir\build.make:202: recipe for target 'bin/libopencv_highgui320.dll' failed<br>
mingw32-make[2]: *** [bin/libopencv_highgui320.dll] Error 1<br>
CMakeFiles\Makefile2:4399: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed<br>
mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2<br>
Makefile:159: recipe for target 'all' failed<br>
mingw32-make: *** [all] Error 2</p>
<p dir="auto">i am getting compilation as mentioned in attached file<br>
<a href="https://github.com/opencv/opencv/files/2534790/Opencv_QT.txt">Opencv_QT.txt</a></p>
<h5 dir="auto">Steps to reproduce</h5>