C# 的视频输入
我有一个视频捕获(USB 网络摄像头)应用程序,当前使用非常旧的 VFW 和 C# 的 p-Invoke 连接。我正在尝试替换它,并且偶然发现了 VideoInput 库,后来发现VideoInputSharp。我设法将 VideoInputSharp 引入我的应用程序,它为我提供了所需的帧速率和相机控制。问题是,在某些 PC 上,即使设备已设置,对 VideoInput.IsFrameNew() 的调用也永远不会返回 true(VideoInput.IsDeviceSetup() 确实返回 true)。 我已在 W7x64 系统和 XPx32 系统上成功运行此程序,但在 W7x32 上不起作用。对于为什么会发生这种情况有什么想法吗?
更新1: 自从最初发布这个问题以来,我发现在不起作用的系统上,我仍然可以调用 VI.ShowSettingsWindow() 来生成对话框;但是,它是一个与我在工作系统上看到的不同的对话框(即使它是相同的相机/驱动程序)。这是一个线索吗?另请注意,我在适用的计算机和不适用的计算机上运行相同版本的 DirectX。
更新2: 出现此问题的系统是 W7x32 和 W7x64,均使用 Microsoft LifeCam。我昨天发现,如果我从机器上删除 Microsoft LifeCam 软件,它就可以工作了!我当然可以对此做出解释。
I have a video capture (usb-webcam) application that currently uses very old VFW with p-Invoke hookup to C#. I'm trying to replace it and I stumbled on the VideoInput library, and later found VideoInputSharp. I managed to get VideoInputSharp into my application and it gives me the frame rate and camera control I need. The problem is that on some PCs the call to VideoInput.IsFrameNew() never returns true even though the device is set up (VideoInput.IsDeviceSetup() does return true).
I've successfully run this on a W7x64 system and a XPx32 system, but does not work on W7x32. Any thoughts on why this is happening?
UPDATE1:
Since originally posting this question, I've found that on the systems that don't work, I am still able to call VI.ShowSettingsWindow() to generate a dialog box; however, it is a different dialog box than I see on the systems that work (even though it is the same camera/driver). Is this a clue? Also note that I'm running the same version of DirectX on the machine it works with and the machine it doesn't work with.
UPDATE2:
The systems that this is failing on are W7x32 and W7x64 both using a Microsoft LifeCam. I found yesterday that if I remove the Microsoft LifeCam software from the machine it then works! I sure could use an explanation for that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论