multiple capture devices - same enumerated name

Feature requests for VLC.
garthb76

multiple capture devices - same enumerated name

Postby garthb76 » 19 Jan 2006 19:45

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.

garthb76

successfully hacked for multiple cameras

Postby garthb76 » 25 Jan 2006 20:12

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

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 25 Jan 2006 21:18

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.
Don't use PMs for support questions.

garthb76

not a complete fix

Postby garthb76 » 26 Jan 2006 00:53

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.

Guest

Postby Guest » 27 Jan 2006 17:32

Names for Directsound output devicelist would be also nice. And for port audio too.

Guest

Postby Guest » 06 Feb 2006 15:11

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

garthb76

reply

Postby garthb76 » 10 Feb 2006 05:55

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

Videoman
Blank Cone
Blank Cone
Posts: 21
Joined: 03 Feb 2006 16:58

Postby Videoman » 10 Feb 2006 07:21

Thanks

Crash32
New Cone
New Cone
Posts: 1
Joined: 15 Mar 2007 20:13

Postby Crash32 » 15 Mar 2007 20:18

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

darthShana
New Cone
New Cone
Posts: 2
Joined: 09 Apr 2007 07:44

mediadirect module ?

Postby darthShana » 09 Apr 2007 07:51

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


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: No registered users and 24 guests