Album Art – Add Album Art Cover to MP3/OGG from Command-Line

audiocommand line

I am looking for a software in Linux, that will add the album-art/cover to each of the selected files in batch-mode. The album art is a jpg/png stored in my computer. It will be awesome if it can import from internet.

Currently I have tried both Rhythmbox and Banshee. I have also tried lame and easytag, but seems they do not support batch mode. lame is not adding the properties, but overwriting. (I know lame is the only command line s/w i have used so far).

So, basically I am looking for:

<some magic s/w> --picture=<my chosen picture> Music/Artist/*.mp3

That will add the picture to the metadata of the file, permanently.

Can you suggest me any such software?

Best Answer

lame

Using lame you can do this using a little scripting:

$ lame --ti /path/to/file.jpg audio.mp3

If the files are named something like this you can make a shell script to do what you want:

for i in file1.mp3 file2.mp3 file3.mp3; do
  albart=$(echo $i | sed 's/.mp3/.jpg/')
  lame --ti /path/to/$albart $i
done

You can make the above slightly more compact and eliminate the need for sed by using bash to do it by having it remove the matching suffix:

...
albart="${i%.mp3}.jpg"
...

Picard/MusicBrainz

If you want to do this on a large scale I'd suggest using Picard which is the frontend tool for using the MusicBrainz database. There is a plugin to Picard called "Cover Art Downloader", which can do this to batches of your collection.

The above doesn't appear to be command line driven however.

beets

Another option would be to use beets. This can be driven from the command-line and makes use of MusicBrainz database for sourcing the album art.

You can either source the album art usingFetchArt Plugin or embed it using the EmbedArt Plugin.

Other options?

Also take a look at this previously asked U&L Q&A titled: Which mp3 tagging tool for Linux?. There are several alternative tools listed in this thread.