50

I have a bunch of MP3 files that have their album art included within the file itself. I am now looking for a way to extract them to store them separably, at best from command line.

Is there a way to achieve this?

6 Answers 6

65

I just found out that ffmpeg will do the trick!

ffmpeg -i file.mp3 -an -c:v copy file.jpg
7
  • 1
    This failed using ffmpeg 2.0.2 on my Synology NAS (file.jpg: Invalid argument), but works using 2.3 on OS X Mavericks. Thanks! Feb 15, 2015 at 7:48
  • It worked on Windows too. Using stackoverflow.com/questions/8397674/… you can process files batch style.
    – Gruber
    Sep 9, 2016 at 18:00
  • This method is great because ffmpeg works on basically any music file you throw at it. However, it seems quite slow, even on a new machine with a i7 processor. Any way to speed extraction up?
    – rien333
    Sep 29, 2018 at 15:21
  • 2
    What if it's a PNG image? Do I have to know image format beforehand? May 9, 2020 at 19:15
  • On a Mac (Mojave), using 'ffmpeg version 4.2.3', it failed with "Invalid PNG signature 0xFFD8FFE000104A46."
    – LOlliffe
    Jun 26, 2020 at 3:59
27

You can use eyed3 which is a great utility for handling id3 tags. To extract all images from an mp3 file you can use:

eyeD3 --write-images=DIR mp3_file

This will write all embedded images from the mp3 file to the specified directory.

2
  • On Ubuntu, the version currently provided (0.6.18) makes corrupt image files.
    – scruss
    Jun 2, 2015 at 10:42
  • you can also use it for adding album art to mp3 files (and all sorts of other manipulations). A very useful tool (used in ubuntu 18.04).
    – BISI
    Aug 15, 2020 at 17:12
4

If you use the Windows version of VLC media player, you can find the album art for all files you played in

 %appdata%\VLC\art\artistalbum

by default. One folder per artist, one subfolder for each album.

1
  • See my answer below for Linux path Apr 14, 2018 at 15:59
2

If you use Linux version of VLC media player, by default you can find the album art for all files you played in a directory similar to this one:

$HOME/.cache/vlc/art/artistalbum/Sergei Rachmaninoff/Paganini Rhapsody _ Piano Concerto no. 2

(one folder per artist, one subfolder for each album)

0

If you use Mac, it is in:

~/Library/Caches/org.videolan.vlc/art

2
  • And how does it get there? (Surely you need to run some program that creates the file(s).)
    – Scott
    Jan 9, 2020 at 1:56
  • It's incorrect to assume everyone on Mac uses VLC. Also incorrect to think it's going to get there magically wihtout ever opening the file with VLC. May 9, 2020 at 19:18
-1

With mp3tag you can do it perfectly. Extract the cover image from one mp3 and put it into another, so it will belong to the same album and that will reflect when you upload them go Google Music for example.

2
  • 3
    It might be helpful to point out a simple example of how one might go about completing the task. E.g., include a few sample commands or choice quotes from the man page to point the OP (and other readers) in the right direction.
    – HalosGhost
    Aug 5, 2016 at 18:49
  • NOT. wanted to post the manpage from mp3tag in unbuntu 18.04, but this is not the place. So here's the SYNOPSIS from the manpage "mp3tag [ -s song ] [ -a artist ] [ -l album ] [ -y year ] [-e comment ] [ -k track ] [ -g genre ] [ -r ] file [ file ... ]" as you can see, no facility for dealing with album art, other than -r, which will "Merge new tag with any preexisting tag in the file"
    – BISI
    Aug 5, 2020 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.