uniquiely differentiate between multiple cameras [dshow, directx, win32api]

和自甴很熟 提交于 2019-12-23 22:14:24

问题


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.

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?


回答1:


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?.



来源:https://stackoverflow.com/questions/11804978/uniquiely-differentiate-between-multiple-cameras-dshow-directx-win32api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!