Listing ALL files for MediaDiscoverer in upnp mode

This forum is about all development around libVLC.
genrtcw
New Cone
New Cone
Posts: 5
Joined: 29 Jun 2022 18:20

Listing ALL files for MediaDiscoverer in upnp mode

Postby genrtcw » 30 Jun 2022 02:39

Dear developers,

I am using libVLCSharp with the Unity VLC asset.

In my app, I am using the mediaDiscoverer to look for "upnp" content.

Code: Select all

mediaDiscoverer = new MediaDiscoverer(libVLC, "upnp"); mediaDiscoverer.Start(); // ... some time later if(mediaDiscoverer.MediaList.Count > 0) { mediaDiscoverer.MediaList[0].ParseAsync(MediaParseOptions.ParseNetwork); } // ... some time later Debug.Log("SubItems.Count: " + mediaDiscoverer.MediaList[0].SubItems.Count);
That works out well, I find my upnp server and it shows me folders and files in the SubItems MediaList.

However, there I find only video, audio and images. I would like to see ALL files. A first step would be to additionally have .txt files, but ideally it should just list all files no matter which extensions - even if the VLC MediaPlayer cannot do anything with it.

Is there a way to achieve this?

Thanks,
Daniel

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

Re: Listing ALL files for MediaDiscoverer in upnp mode

Postby Rémi Denis-Courmont » 30 Jun 2022 08:32

No.
LibVLC is a media playback API, not a generic file storage abstraction.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Alaric
Developer
Developer
Posts: 36
Joined: 27 Apr 2022 18:37

Re: Listing ALL files for MediaDiscoverer in upnp mode

Postby Alaric » 30 Jun 2022 16:23

What's you use case ?
VLC's upnp client will list files that it's able to play (audio / video and possibly images). For the subtitles, they should be linked to the media you discovered and you probably can access those via a libvlc mechanism. But VLC won't list them as standalone media.

genrtcw
New Cone
New Cone
Posts: 5
Joined: 29 Jun 2022 18:20

Re: Listing ALL files for MediaDiscoverer in upnp mode

Postby genrtcw » 30 Jun 2022 23:05

Thanks a lot for your replies!

Sure, libVLC focuses on media which is fine and great to have this. Just for my case, it would be nice if it could also do that feature for files. After all, it is advertised for "Network browsing for distant filesystems (SMB, FTP, SFTP, NFS...) and servers (UPnP, DLNA)". Which it does and works great, just not for all file types in the case of UPnP :-).

My use case is a custom image viewer which reads in additional text files for extra information. For example, if for the file a.jpg, there is also a file a.txt, it will use it to add more information, e.g. a text description, when showing that image. While this could be done with tricks in the metadata of the jpg files, it is easier to edit in a .txt file.

I don't know the implementations of UPnP / DLNA in too much detail: do these servers in general support a request to have all files listed? If yes, would there be a good way to modify libVLC myself to just change the request from media files to all files? Any thoughts on that?

Thanks,
Daniel

Alaric
Developer
Developer
Posts: 36
Joined: 27 Apr 2022 18:37

Re: Listing ALL files for MediaDiscoverer in upnp mode

Postby Alaric » 01 Jul 2022 10:41

This is achievable by setting your text files as captions for the image in the upnp server, then possibly libvlc will list the text files as generic slaves.
But IMO, this goes a bit out of libvlc scope, I would simply reimplement the upnp client on your side using libupnp or whatever wrapper to achieve your task.

genrtcw
New Cone
New Cone
Posts: 5
Joined: 29 Jun 2022 18:20

Re: Listing ALL files for MediaDiscoverer in upnp mode

Postby genrtcw » 02 Jul 2022 13:22

Thanks a lot! I will have a look at libupnp and see if that would make it easier to achieve this. Also great idea to use the text file as captions, maybe that could work.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests