How does VLC/libVLC recognizes connected cameras?

This forum is about all development around libVLC.
vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

How does VLC/libVLC recognizes connected cameras?

Postby vale4674 » 18 Oct 2011 11:55

I've been using VLCJ (which uses libVLC). Now I need to list available cameras and it has to be cross platform.
What is the way that VLC/libVLC is doing this? When I go to capture mode it lists available devices and I would like to do the same.

Rémi Denis-Courmont
Developer
Developer
Posts: 15133
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How does VLC/libVLC recognizes connected cameras?

Postby Rémi Denis-Courmont » 18 Oct 2011 12:49

In principles, you would use libvlc_media_discoverer_new_from_name(..., "video"), but the API might need to be improved first (I don't know, I never used it personally). And well, the back-end is only implemented on Linux (udev) as of VLC version 1.2.

Basically, someone needs to take up this work item, as the previous media discovery API developer left the project to focus on his day job.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

Re: How does VLC/libVLC recognizes connected cameras?

Postby vale4674 » 18 Oct 2011 14:38

If I understood correctly, the person who developed this is no longer working on it?

But how is it possible on VLC to discover all cameras if it is only implemented for linux?
If I run VLC on MAC it lists me iSight camera. If I run it on Windows (through virtual machine) I got the list as well.

Rémi Denis-Courmont
Developer
Developer
Posts: 15133
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How does VLC/libVLC recognizes connected cameras?

Postby Rémi Denis-Courmont » 18 Oct 2011 16:22

Hmm, lets clarify. The guy that wrote the media discoverer API has left the project. So it is not unlikely that the API has problems (bugs, awkwardness, limitations...).

Now regarding video capture specifically, there is a dedicated service discovery plug-in ("v4l") based on libudev. This is obviously platform-specific stuff, and nobody ever wrote a comparable back-end plug-in for Windows, MacOS, BSD or whatever else.

So basically, what you ask is theoretically possible and in scope, but it is not working at the moment, except maybe on Linux.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

Re: How does VLC/libVLC recognizes connected cameras?

Postby vale4674 » 18 Oct 2011 18:42

Hmm, lets clarify. The guy that wrote the media discoverer API has left the project. So it is not unlikely that the API has problems (bugs, awkwardness, limitations...).
I understand.
Now regarding video capture specifically, there is a dedicated service discovery plug-in ("v4l") based on libudev. This is obviously platform-specific stuff, and nobody ever wrote a comparable back-end plug-in for Windows, MacOS, BSD or whatever else.

So basically, what you ask is theoretically possible and in scope, but it is not working at the moment, except maybe on Linux.
Maybe I wasn't clear with my question. I asked what is the EXACT way that VLC populates that combo-boxes with available cameras. I assume that there is some native library which is OS specific. I thought that this is libVLCs responsibility but obviously it is not.

If I now what libraries are responsible for that, then I could write my own java mapper to map that native libraries just like VLCJ is built over libVLC.

If this is not libVLC responsibility then maybe I should ask this question on some other VideoLAN forum?

Rémi Denis-Courmont
Developer
Developer
Posts: 15133
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How does VLC/libVLC recognizes connected cameras?

Postby Rémi Denis-Courmont » 18 Oct 2011 19:28

The capture devices in the playlist come from the same back-end as media discoverer.

I am not sure which combox you mean. On Linux, the Qt4 UI capture dialog is lame, it just lists /dev/video* entries.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

Re: How does VLC/libVLC recognizes connected cameras?

Postby vale4674 » 18 Oct 2011 20:07

I am not sure which combox you mean. On Linux, the Qt4 UI capture dialog is lame, it just lists /dev/video* entries.
Combo-boxes when I go on capture/convert media.

VLC for Mac OS X
Image

VLC for Windows (Windows are run from virtual machine here)
Image
The capture devices in the playlist come from the same back-end as media discoverer.
I would appreciate if you could point me somewhere, to some starting point of that back-end, so I could see what can I do with it. Thank you.

Rémi Denis-Courmont
Developer
Developer
Posts: 15133
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How does VLC/libVLC recognizes connected cameras?

Postby Rémi Denis-Courmont » 18 Oct 2011 21:16

I don't know how MacOS does it, but I guess it's hard-coded in the user interface, which is MacOS-specific anyway.

On Windows, there is specifc support code in the Qt4 UI.

Service discovery plugins are all in modules/services_discovery/
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

carlesls
Blank Cone
Blank Cone
Posts: 24
Joined: 17 Jun 2011 13:42

Re: How does VLC/libVLC recognizes connected cameras?

Postby carlesls » 02 Nov 2011 12:50

I've been using VLCJ (which uses libVLC). Now I need to list available cameras and it has to be cross platform.
What is the way that VLC/libVLC is doing this? When I go to capture mode it lists available devices and I would like to do the same.
And what is a "connected camera"? there are infinite IP cameras "connected" and their streams on the internet...

Rémi Denis-Courmont
Developer
Developer
Posts: 15133
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How does VLC/libVLC recognizes connected cameras?

Postby Rémi Denis-Courmont » 02 Nov 2011 13:08

A connected camera is one that can be enumerated from the (camera) device manager abstraction of the operating system.

Just because you cannot automatically list (RTSP) IP cameras, is not an excuse for ignoring the USB, PCI, FireWire and built-in devices.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests