Saturday, April 19, 2014

Editing MP3/ID3 tags

A couple of days ago someone asked me how to change the ID3 tag in MP3 files via commandline. There are a couple of programs out there and the first one I found did the job right: id3ed
To get id3ed running download the source from first. Then extract the tar file and build the source:

# tar xf id3ed-1.10.4.tar.gz
# cd id3ed-1.10.4
# configure
# make
# make install

id3ed will be installed under /usr/local/bin/id3ed and the manpage under
/usr/local/man/man1/id3ed.1. Start using id3ed by showing the current
ID3 tag for a sample MP3 file:

$ id3ed -i 01\ Song\ Name.mp3
01 Song Title.mp3: (tag v1.1)

The above output indicates that no ID3 tag for that MP3 file is set. You can set one easily by executing:

$ id3ed \
  -s "Song Name" \
  -n "Artist Name" \
  -a "Album Name" \
  -y 1984 \
  -c "" \
  -k 1 \
  -g "Rock" \
  -q \
  01\ Song\ Title.mp3

Where the following options were used:

-s: name of the song
-n: name of the artist
-a: name of the album
-y: year
-c: any comment
-k: track number
-g: the genre
-q: without that option id3ed asks for acknowledge for each setting
01\ Song\ Title.mp3: the MP3 file itself

Last step is to showing the ID3 tag again:

$ id3ed -i 01\ Song\ Name.mp3
01 Song Title.mp3: (tag v1.1)
songname: Song Title
artist: Artist Name
album: Album Name
year: 1984
tracknum: 1
genre: Rock(17)

As you can see above the ID3 tag was set successfully.