Page 1 of 1

multiple capture devices - same enumerated name

Posted: 19 Jan 2006 19:45
by garthb76
I am trying to stream 4 different Logitech Pro 4000's but because they have the same name in the enumerated list, VLC will only play one of them. However if there are 4 webcams of different names, then everything works fine.

Now in dshow.cpp I noticed that in function FindCaptureDevice line 1109
a call is made as following:

hr = p_bag->Read( L"FriendlyName", &var, NULL );

Now if you notice the first parameter is using the "FriendlyName" of the device from the registry I assume. Well in my case the friendly names are all the same for these cameras. Even attempting to change these names in the registry however does not solve the problem. Any help would be appreciated.

successfully hacked for multiple cameras

Posted: 25 Jan 2006 20:12
by garthb76
In the file dshow.cpp change the line:

hr = CoCreateInstance( CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
IID_ICreateDevEnum, (void **)&p_dev_enum );
to


hr = CoCreateInstance( CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
IID_ICreateDevEnum, (void **)&p_dev_enum );

and change


hr = p_bag->Read(L"FriendlyName", &var, 0);
to

hr = p_bag->Read(L"DevicePath", &var, 0);

Recompile and that does the trick

Posted: 25 Jan 2006 21:18
by The DJ
A ticket has been created: http://trac.videolan.org/vlc/ticket/519
I trust someone will commit the fix soon.

Thank you so much for providing the solution, I know a lot of ppl have been looking forward to this.

not a complete fix

Posted: 26 Jan 2006 00:53
by garthb76
It fixes the problem of multiple cameras, but there is a remaining issue that this creates. Using the DevicePath rather than the FriendlyName for the enumerated list makes the list unintelligible, that is rather than the device name appearing in the Enumerated list, it is a cryptic string of symbols that uniquely identifies the specific webcam. If I have time I will fix this as well, but if not all one would have to do is create some kind of link between the unique identifier (DevicePath) and the name (FriendlyName). The important thing is that the FriendlyName be displayed and the DevicePath be used for the data to init and start the device.

Posted: 27 Jan 2006 17:32
by Guest
Names for Directsound output devicelist would be also nice. And for port audio too.

Posted: 06 Feb 2006 15:11
by Guest
garthb76


I am doing same thing as you (Multiple web cameras and TV channels ). Today I do mulitple web cameras streaming with VLC 0.8.5 + VLM and found same problem as you.

I am not familiar with software programming so I do not know how to modify the source code. Could you tell me where to get your modifed VLC for multiple web cameras streaming?

Thanks

Videoman

reply

Posted: 10 Feb 2006 05:55
by garthb76
Get a copy of the source code, make the changes in dshow.cpp, and then use cygwin to recompile. The VLC developers homepage has a pretty comprehensive how-to for recompilation. Take note however, that this is not a complete fix, there is a residual effect of mangled strings in the drop down list that I mentioned in a previous post.

-Garth Boyst

Posted: 10 Feb 2006 07:21
by Videoman
Thanks

Posted: 15 Mar 2007 20:18
by Crash32
Hi

Sorry for the late Post in this Thread, but i got the same problem.

I'm using VS2005 Express and the latest PSDK.

If is use the following code, the read-function doesnt succeed:

Code: Select all

if(CoCreateInstance(CLSID_FilterGraph,NULL,CLSCTX_INPROC_SERVER,IID_IFilterGraph,(void**)&myFilterGraph)!=S_OK) { MessageBox(g_hWnd,(LPCTSTR)L"FilterGraph konnte nicht gestartet werden",(LPCTSTR)L"Fehler",MB_OK); myFilterGraph=NULL; } if(CoCreateInstance(CLSID_SystemDeviceEnum,NULL,CLSCTX_INPROC,IID_ICreateDevEnum,(void**)&myDeviceEnumerator)!=S_OK) { MessageBox(g_hWnd,(LPCTSTR)L"SystemDeviceEnumerator konnte nicht gestartet werden.",(LPCTSTR)L"Fehler",MB_OK); myDeviceEnumerator=NULL; } hr=myDeviceEnumerator->CreateClassEnumerator(CLSID_VideoInputDeviceCategory,&myEnumCategory,0); if(hr==S_OK) { //erfolgreich, also alle Devices auflisten IMoniker* myMoniker; while(myEnumCategory->Next(1,&myMoniker,&cFetched)==S_OK) { //ein weiteres Device gefunden hr=myMoniker->BindToStorage(0,0,IID_IPropertyBag,(void**)&myDeviceEigenschaften); if(hr==S_OK) { VARIANT var; VariantInit(&var); hr=myDeviceEigenschaften->Read(L"DevicePath",&var,NULL); if(hr==S_OK) { MessageBox(g_hWnd,(LPCWSTR)var.bstrVal,(LPCWSTR)L"Name",MB_OK); } VariantClear(&var); myDeviceEigenschaften->Release(); } myMoniker->Release(); } } else { MessageBox(g_hWnd,(LPCWSTR)L"CreateClassEnumerator schlug fehl",(LPCWSTR)L"Fehler",MB_OK); myEnumCategory=NULL; }
Does anyone know every Name of Property to use with the Read Function?
Or depends the available Propertys of the device?

Sorry for the bad English.

Reinhold Fischer

mediadirect module ?

Posted: 09 Apr 2007 07:51
by darthShana
Hi i think im having the same problem while trying to work with multiple cameras...
i made the sugested chnages and succesfully recomplied and started vlc. However now the media direct tab is missing i have a capture device tab which does not list the cameras.. however the reased version i installed had a media direct tab which did display the cameras...

is there a media direct module that i need to download ?