问题描述
有没有可以通过编程方式区分多个摄像机的方法?
我在每个IMoniker枚举CLSID_VideoInputDeviceCategory,然后我GetDisplayName。我发现,用一些摄像机将它们插入不同的USB插座将返回您不同的唯一ID,也就是说,相同的摄像机插入到不同的插座被我的程序视为多个摄像机连接在不同的时间。插入不同usb套接字的其他摄像机用相同的GetDisplayName标识。最重要的是,我有两个相同的相机(Microsoft LifeCam HD-3000),当我插入不同的硬件件到同一个插座,我不能告诉区别插入硬件件。
Is there a sure way to programmatically differentiate between multiple cameras?I enumerate CLSID_VideoInputDeviceCategory and then I GetDisplayName on each IMoniker. What I found out is that with some cameras plugging them into different USB socket will return you different unique ID, that is, same camera plugged in into different sockets is regarded by my program as multiple cameras attached at different time. Other cameras plugged into different usb sockets are identified with the same GetDisplayName. On top of that, I have two identical cameras (Microsoft LifeCam HD-3000) and when I plug in different hardware pieces into the same socket I can't tell the difference which hardware piece was inserted.
那么,有没有办法真正地告诉多个相同的摄像头之间的区别,如果我把它们插入同一个USB端口?
So, is there a way to really tell the difference between multiple identical cameras if I plug them into the same usb port? And related reverse question: how can I id the same camera when I plug it in into different usb sockets?
推荐答案
取决于具体的可用性的USB设备序列号,重新插入到不同的端口将给你相同或不同的名称显示名称。还是moniker显示名称是你能做的最好的。在此处查看有关此主题的更多信息:。
Depending on availability of serial number of USB device, re-plugging it into different port will give you the same or different moniker display name. Still moniker display name is the best you can do. See more on this topic here: How to identify a video device correctly?.
这篇关于唯一区分多个摄像机[dshow,directx,win32api]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!