Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 762
Pavel P Avatar asked Sep 03 '25 05:09

Pavel P


1 Answers

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

like image 75
Roman R. Avatar answered Sep 05 '25 00:09

Roman R.