I'm using aForge.NET library in c# app to access camera device on tablet Lenovo Yoga 2 (build-in camera).
I'm trying to setup specific (maximal possible) resolution of stream. To do that, I'm using VideoCapabilities property of VideoCaptureDevice object. I belive that list of VideoCapabilities is not complete. My question is 'why?' and is it possible to retrive more of them (VideoCapabilities)?
Or else, if there is no way to get higher resolution, how to check and be sure that my build in camera run only with those retrived from VideoCapabilities property?
What makes me belive that I should see more resulutions:
I've checked DirectShow capabilities with DirectShowCaptureCapabilities-Win32.exe application. It gives me much more Capabilities. For example 1280x960 that I'm trying to setup.
after running default Windows application (from tablet lock screen), I'm seeing preview from bigger resolution - probably 1280x960
running code from sample aForge.NET application (Snapshot Maker) in version 2.2.5 library im getting 5 different capabilities while running the same code with version 2.2.0 of libraries gives me 10 different capabilities
code is:
videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );
...
videoDevice = new VideoCaptureDevice( videoDevices[devicesCombo.SelectedIndex].MonikerString );
videoCapabilities = videoDevice.VideoCapabilities;// that gives me not full list of capabilities
...
videoDevice.VideoResolution = videoCapabilities[videoResolutionsCombo.SelectedIndex];
After a little discovery, thats what I've achieved
Aforge Developer told me that:
the list may be incomplete. Especially on these modern tablets, which tend to provide high resolution, but with small bits per pixel value.
First, all 12 bpp resolutions are ignored, since cause issues in VideoCaptureDevice. Until fixed, those resolutions are simply ignored. Second, as you can see from the code, only the highest BPP is reported. So if you have two resolutions like 640x480x32 and 640x480x24, then only the x32 is shown.
Here is the code.
Also, If any of you would have similar problem - be aware that cameras expose their features not only through popular DirectShow interface, but also others or may have their own API. So try to look at these also.
Resolution that I've wanted to achieve was given to me only through MediaCapture Api. But that is dedicated for Windows Store Aps / UWP. There are easy to find ways to use it under Windows 8/8.1 desktop apps.