Extract art from media through libvlc

This forum is about all development around libVLC.
marcsto
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Sep 2008 15:27

Extract art from media through libvlc

Postby marcsto » 19 Oct 2008 04:35

Hello,

Songs may have art embedded in them (ex: an mp3 file can have album art). How does VLC expose this information?

What I know so far:
1. I can get access to the art url by using "libvlc_meta_t.libvlc_meta_ArtworkURL"
This will return "attachment://" if the art is embedded in the file.

2. I see that the file "src/input/meta.c" has lots of code that appears to extract the image itself from the media file.

Does anyone know how I can access this data using libvlc (or anything else)? I want to be able to display album art in my application which uses libvlc as its media player.

Thank you,
Marc

bilb68
New Cone
New Cone
Posts: 4
Joined: 06 Jun 2014 11:38

Re: Extract art from media through libvlc

Postby bilb68 » 11 Jun 2014 22:27

Hi, did you solve your problem? I am faicing the same currently...

MickeyMoneysac
New Cone
New Cone
Posts: 6
Joined: 27 Dec 2019 15:28

Re: Extract art from media through libvlc

Postby MickeyMoneysac » 28 Dec 2019 12:58

Using Linux libvlc extracts the album art to /home/USERNAME/.cache/vlc/art/artistalbum/ARTIST/ALBUM/art.jpg

If you are a fan of C you can use sprintf to produce this:

Code: Select all

sprintf (uri, "/home/%s/.cache/vlc/art/artistalbum/%s/%s/art.jpg", getenv("USER"), artist, album) ;

MickeyMoneysac

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: Extract art from media through libvlc

Postby mangokm40 » 30 Dec 2019 14:16

I mentioned this in a previous thread.

In Windows, I use the call to libvlc_media_get_meta() with "libvlc_meta_ArtworkURL".
For ".mp3" files, this gives me a string that starts with "file:///". This string gives me the local path (ie: c:/folder/...).
However, for ".flac" files, this gives me a string that starts with "attachment://". In this case, the art is NOT being copied to
the local folder.

Do a search for that thread. I think you can expect the behavior to change for libvlc 4.0, if I remember the response on that thread correctly.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 22 guests