Aforge VideoCapabilities 列表 - 可能不完整?
Aforge VideoCapabilities list - may it be incomplete?
我在 c# 应用程序中使用 aForge.NET 库来访问平板电脑 Lenovo Yoga 2(内置摄像头)上的摄像头设备。
我正在尝试设置流的特定(最大可能)分辨率。为此,我使用了 VideoCaptureDevice 对象的 VideoCapabilities 属性。
我相信 VideoCapabilities 列表并不完整。我的问题是 'why?' 是否可以检索更多(VideoCapabilities)?
否则,如果没有办法获得更高的分辨率,如何检查并确保我的内置相机 运行 仅使用从 VideoCapabilities 属性 检索到的相机?
是什么让我相信我应该看到更多结果:
我已经检查了 DirectShowCaptureCapabilities-Win32.exe 应用程序的 DirectShow 功能。它给了我更多的能力。例如我正在尝试设置的 1280x960。
在 运行 启用默认 Windows 应用程序(来自平板电脑锁定屏幕)之后,我看到了更大分辨率的预览 - 可能是 1280x960
运行来自示例 aForge.NET 应用程序 (Snapshot Maker) 的 2.2.5 版库中的代码我获得了 5 种不同的功能,而 运行 使用相同的代码2.2.0 版的库为我提供了 10 种不同的功能
代码是:
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];
经过一点发现,这就是我所取得的成就
Aforge 开发者告诉我:
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.
这里是 code.
此外,如果你们中的任何人遇到类似问题 - 请注意,相机不仅通过流行的 DirectShow 界面公开其功能,而且还通过其他界面公开其功能,或者可能有自己的 API。所以也试着看看这些。
我想要实现的决心是通过 MediaCapture Api 才得到的。但这专用于 Windows Store Aps / UWP。
在 Windows 8/8.1 桌面应用程序下可以轻松找到使用方法。
我在 c# 应用程序中使用 aForge.NET 库来访问平板电脑 Lenovo Yoga 2(内置摄像头)上的摄像头设备。
我正在尝试设置流的特定(最大可能)分辨率。为此,我使用了 VideoCaptureDevice 对象的 VideoCapabilities 属性。 我相信 VideoCapabilities 列表并不完整。我的问题是 'why?' 是否可以检索更多(VideoCapabilities)?
否则,如果没有办法获得更高的分辨率,如何检查并确保我的内置相机 运行 仅使用从 VideoCapabilities 属性 检索到的相机?
是什么让我相信我应该看到更多结果:
我已经检查了 DirectShowCaptureCapabilities-Win32.exe 应用程序的 DirectShow 功能。它给了我更多的能力。例如我正在尝试设置的 1280x960。
在 运行 启用默认 Windows 应用程序(来自平板电脑锁定屏幕)之后,我看到了更大分辨率的预览 - 可能是 1280x960
运行来自示例 aForge.NET 应用程序 (Snapshot Maker) 的 2.2.5 版库中的代码我获得了 5 种不同的功能,而 运行 使用相同的代码2.2.0 版的库为我提供了 10 种不同的功能
代码是:
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];
经过一点发现,这就是我所取得的成就
Aforge 开发者告诉我:
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.
这里是 code.
此外,如果你们中的任何人遇到类似问题 - 请注意,相机不仅通过流行的 DirectShow 界面公开其功能,而且还通过其他界面公开其功能,或者可能有自己的 API。所以也试着看看这些。
我想要实现的决心是通过 MediaCapture Api 才得到的。但这专用于 Windows Store Aps / UWP。 在 Windows 8/8.1 桌面应用程序下可以轻松找到使用方法。