I wrote an app to capture and display the video from my webcam, with a slider to change the camera exposure. Works great.
However, I want this so I can adjust my camera exposure before entering a web meeting, and I would like to run it while the web meeting preview is open, and this doesn’t work. If I open the web meeting preview first then the opencv capture doesn’t work. If I run my app first then the web meeting preview fails to initialize the camera.
I can create a VideoCapture object, and capture.Open() works (or at least capture.IsOpened() is true, and settings such as exposure seem correct) but capture.Grab() returns false, and capture.RetrieveMat() returns an empty material.
Is there an option to open the capture device in non-exclusive mode, so that my app and the web meeting preview can both access the camera? I know in theory this is possible, because I can use other third party apps (e.g. OBS Studio) to capture the camera while the web meeting preview is active.
I’m using Windows 10, with the OpenCVSharp4 C# wrapper in a WPF application. My web meeting software is Google Meet. I hope none of this matters and that there is a feature of VideoCapture that I need to use in order to enable non-exclusive access to the camera.
Thanks for any suggestions!