I did open an issue regarding the MSMF and DSHOW problem, it clearly looks to me like an unwanted behaviour.
opened 07:21AM - 10 May 21 UTC
category: videoio(camera)
platform: win32
##### System information (version)
- OpenCV => 4.5.2.52
- Python: Python 3.9.4…
- Operating System => Windows 64 Bit (20H2)
##### Detailed description
If I start one camera with CAP_MSMF and the second one with CAP_DSHOW a bit later, then it fails to open the CAP_DSHOW camera.
If i do it the other way around it works without problem.
In another program I experienced the situation, that it even interrupted the reading of the CAP_MSMF camera with the following error, if I started the second camera with CAP_DSHOW later.
`[ WARN:0] global C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-m8us58q4\opencv\modules\videoio\src\cap_msmf.cpp (1021) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638
`
[This](https://forum.opencv.org/t/using-cap-msmf-and-cap-dshow-at-same-time-with-two-cameras-causes-cant-grab-frame-error-2147483638/3239) is the according discussion in the OpenCV forum.
##### Steps to reproduce
During my tests a had two USB webcams connected via a USB 3.0 hub.
**`test1.py`**, which uses `CAP_MSMF`:
```
import cv2
import numpy as np
#video = cv2.VideoCapture(0, cv2.CAP_DSHOW)
video = cv2.VideoCapture(0, cv2.CAP_MSMF)
if video.isOpened(): # try to get the first frame
rval, frame = video.read()
else:
rval = False
while 1:
cv2.imshow("preview1", frame)
rval, frame = video.read()
key = cv2.waitKey(1)
if key == 27: # exit on ESC
break
```
**`test2.py`**, which uses `CAP_DSHOW`:
```
import cv2
import numpy as np
video = cv2.VideoCapture(1, cv2.CAP_DSHOW)
#video = cv2.VideoCapture(1, cv2.CAP_MSMF)
if video.isOpened(): # try to get the first frame
rval, frame = video.read()
else:
rval = False
while 1:
cv2.imshow("preview2", frame)
rval, frame = video.read()
key = cv2.waitKey(1)
if key == 27: # exit on ESC
break
```
If I start `test2.py` (`CAP_DSHOW`) first and after it `test1.py` (`CAP_MSMF`), then everything is fine and both videos are shown.
But if I do it the other way around, then `video.isOpened()` in test2.py returns false and it is not possible to read a frame.
The behavior is a bit different to the issue which happened during my test with a thermal cam (it interruped an already opened camera frame reading with the error mentioned above), but it points out that there is a problem using `CAP_DSHOW` and `CAP_MSMF` at the same time.
Not sure about the CAP_PROP_CONVERT_RGB
issue, maybe I do not understand completly how it should work.
Would you say that these results there are how it should be? Or should it return a 1D uint8 array in every situation if CAP_PROP_CONVERT_RGB
is set to 0?