you should set CAP_PROP_FOURCC (pixel format) to something sensible like VideoWriter::fourcc(‘R’,‘G’,‘B’,‘A’) (whatever your camera reports in its capabilities), then hope that your device gives you that.
cap >> frame
is equivalent to cap.read(frame)
if you don’t have any other means of enumerating your device capabilities and choices of fourcc/pixel format (to check that your device reports them correctly…), ffmpeg can help you
https://trac.ffmpeg.org/wiki/DirectShow
and you may need to pin apiPreference
to CAP_DSHOW or CAP_MSMF, whichever works for you.
again, since this CONVERT_RGB=0
is a new feature, I have no idea if that’ll give you the entire frame, or do something stupid with the length, or even report some kind of width and height that may or may not be sensible.
if you encounter problems, make sure to run on the latest release (4.9), browse open and closed bug reports that could be related, and dig around in the source of the videoio module.