directshow.net 视频输入设备过滤器枚举是否已损坏(在较新的环境中)? [英] Is directshow.net video input device filter enumeration broken (in newer environments)?

查看:27
本文介绍了directshow.net 视频输入设备过滤器枚举是否已损坏(在较新的环境中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

directshow.net 示例文件夹(标记为2010-February")中的每个示例都可以很好地编译,并且那些从文件播放视频的示例效果很好.但是,每个尝试枚举 FilterCategory.VideoInputDevices 的示例总是找不到我的任何过滤器,特别是 DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);总是返回我没有设备.我在使用 directshow.net 的所有其他程序中都会出现同样的问题,例如 touchless 和 codeplex 上的各种示例.

Every example in the directshow.net samples folder (marked "2010-February") compiles fine, and those that play videos from files work great. However, every example that tries to enumerate the FilterCategory.VideoInputDevices always fails to find any of my filters, specifically DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); always returns that I have no devices. This same problem occurs for me in every other program that uses directshow.net, like touchless and the various examples on codeplex.

我安装了 4 个视频输入过滤器(1 个网络摄像头和 3 个屏幕捕获过滤器),Windows SDK 和 rl 过滤器管理器附带的图形编辑器可以找到/使用它们.这两个程序都在视频捕获源"下列出了四个过滤器,每个 Moniker 都以 directshow.net 的 FilterCategory.VideoInputDevices 指向的正确 GUID 开头(860BB310-5D01-11D0-BD3B-00A0C911CE86").

I've got four video input filters installed (1 webcam and 3 screen-capturing filters) and they're found/usable by the graph editor that comes with the Windows SDK and the rl Filter Manager. Both programs list the four filters under "Video Capture Sources" and each Moniker starts with the correct GUID that directshow.net's FilterCategory.VideoInputDevices points to ("860BB310-5D01-11D0-BD3B-00A0C911CE86").

我自己尝试编译和使用最新的 directshow.net dll,但没有任何改变.

I've tried compiling and using the latest directshow.net dll myself, but nothing changed.

为什么包装器可以使视频渲染过滤器很好,但不能枚举视频捕获过滤器?我在 64 位的 win7 sp1 上,使用 Visual C# 2010 express.我的环境中是否有某些原因导致了这种情况?如果我知道是什么导致了变化,我很乐意自己处理.

Is there some reason why the wrapper can get the video rendering filters fine but not enumerate video capturing ones? I'm on win7 sp1, 64bit, using visual C# 2010 express. Is something in my environment causing this? I'd gladly handle the change myself if I knew what is causing it.

感谢您的宝贵时间.

推荐答案

我将 GetDevicesOfCat 的代码复制到我的项目中并开始调试它.如果我将 VideoInputDevice 以外的任何 FilterCategory 交给它,它将获得 GraphEdit 列出的大多数过滤器,但它仍然缺少大多数类别中的一些过滤器.我猜想过滤器的某些属性使它们无法在我编译的 GetDevicesOfCat 版本中获得.

I copied the code for GetDevicesOfCat into my project and started debugging it. If I handed it any FilterCategory other than VideoInputDevice, it would get most of the filters that GraphEdit lists, but it was still missing some in most of the categories. I guessed that there was some property of the filters that made them unobtainable to my compiled version of GetDevicesOfCat.

事实证明,只需将我的平台目标切换到 x86 就可以解决问题,尽管它在 VS2010 Express 中并不那么简单(对于全新安装,在执行第一个答案之前,您必须遵循第二个答案):在 Visual Studio 2010 Express 中更改目标 CPU 设置

It turns out simply switching my platform target to x86 does the trick, though it's not as straightfoward in VS2010 Express (for a fresh install, you'll have to follow the second answer before you do the first): Change target CPU settings in Visual Studio 2010 Express

程序现在成功枚举了我的所有过滤器.

The program now successfully enumerates all of my filters.

这篇关于directshow.net 视频输入设备过滤器枚举是否已损坏(在较新的环境中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆