c# - Aforge VideoCapability 列表 - 可能不完整?

标签 c# webcam tablet aforge

我在 C# 应用程序中使用 aForge.NET 库来访问平板电脑 Lenovo Yoga 2(内置摄像头)上的摄像头设备。

我正在尝试设置流的特定(最大可能)分辨率。为此,我使用 VideoCaptureDevice 对象的 VideoCapability 属性。 我相信视频功能列表并不完整。我的问题是“为什么?”是否有可能检索更多内容(视频功能)?

否则,如果无法获得更高的分辨率,如何检查并确保我的内置相机仅运行从 VideoCapabilties 属性检索的内容?

是什么让我相信我应该看到更多结果:

  • 我已使用 DirectShowCaptureCapabilities-Win32.exe 检查了 DirectShow 功能应用。它给了我更多的能力。例如我正在尝试设置的 1280x960。

  • 运行默认 Windows 应用程序(从平板电脑锁定屏幕)后,我可以看到更大分辨率的预览 - 可能是 1280x960

  • 在 2.2.5 版库中运行示例 aForge.NET 应用程序(Snapshot Maker)的代码可以获得 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 接口(interface)公开其功能,而且还通过其他接口(interface)公开其功能,或者可能有自己的 API。所以也尝试看看这些。

我想要实现的解决方案只能通过MediaCapture Api给我。 。但这是专用于 Windows Store Aps/UWP 的。 在 Windows 8/8.1 桌面应用程序下很容易找到使用它的方法。

关于c# - Aforge VideoCapability 列表 - 可能不完整?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35596145/

相关文章:

c++ - 如何使用 OpenCV 从网络摄像头获取孔径角?

javascript - 网络摄像头快照到 Canvas

c# - 如何在我的可视化 C# 表单中使用 zxing.net

c# - WPF画笔颜色从win10到win8平板电脑发生变化

c# - 正则表达式替换特殊字符

c# - linq sum如何显示为货币

c# - 如何在linq中使用foreach

c# - 是 C#'s attributes better designed than Java' 的注释吗?

android - 如何从终端/外壳调整物理 android 屏幕的大小

javascript - 平板电脑(即 iPad)上的悬停效果?