Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to read the mp3 tags of a file from the shell? Something like: mp3tags MyFile.mp3 author should output the author-tag of an mp3-file.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

Ok, I found a program by myself. It is called mp3info and installed by

sudo apt-get install mp3info

To get single mp3 tags from a file, one has to call

mp3info -p %a file.mp3

which gives the artist of the file. The %a means that one want to get the artist and there are some other keys for the other tags.

share|improve this answer
3  
Additional info: There are 4 different standards of mp3 tags id3v1, id3v2.2(obsolete), id3v2.3, id3v2.4 en.wikipedia.org/wiki/ID3. A file can have v1 and/or v2 tags (Yes v1 and v2 can coexist, but v2.x and v2.y cannot coexist). I believe v2.3 is the most widely used one. According to ibiblio.org/mp3info (See Todo) v2 tags are not supported by mp3info. You might want to look at id3v2 - It can edit/add v2 and display v1 and v2. If you don't like the way it displays the tags you can write a script that runs id3v2 and processes the output appropriately. –  S Prasanth Dec 11 '12 at 8:04
    
@SPrasanth how to make it to display a specific tag. For example: only the artist of an mp3 file? –  Gowtham Apr 23 at 11:10
    
@SPrasanth I got it. Thanks I'm using -R flag with grep to get the specified output. –  Gowtham Apr 23 at 11:14

You can use eyed3. First, from a terminal, install:

sudo apt-get install eyed3

Then, run:

eyed3 song.mp3

Combine that with grep to get specific tags in one line.

eyed3 song.mp3 | grep artist

(to strip all mp3 tags, see HERE)

share|improve this answer
1  
I tried this, and the command to use is eyeD3, with an uppercase D ;). But I found another tool, which better matches my needs, named mp3info. This can output mp3 tags without the need to use grep, which I prefer. –  red_trumpet Dec 8 '12 at 13:29
    
eyeD3 works better for me because it works with id3v2, but @red_trumpet is right, the command should be eyeD3 not eyed3 –  bmaupin May 29 '13 at 4:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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