id3 tag info

Tags for mp3 files

…preparing for an actual document on the matter… some day…


id3v1

These go at the end of the file. This makes it quick and easy to attach (and remove) without much fuss.

Segments are fixed-length, which (obviously) limits the content.

 

All text fields use ISO-8859-1. Not everybody seems to get this…

Basic block

At the very end of the file
Size
(bytes)
Name
(type)
 3 Block type identifier String “TAG
30 Track title Text
30 Artist
30 Album
4 Year
30
v1.0 v1.1
30 Comment Text 28 Comment Text
1 (zero) $00
1 Track No.

Since the “Zero” marker in the comment field is what marks the block as being v1.1, any non-zero value removes the next byte as a track-number field and sets the comment field length to 30 bytes.

1 Genre

Extension

Last thing before the basic block
Size
(bytes)
Name
(type)
 4 Block type identifier String “TAG+” for ID3v1 extension data
60 Track title Added to the fields in the basic block
60 Artist
60 Album
1 Speed 0004
30 Genre Text
6 Start time String “mmmm:ss”, e.g. “0004:20” for “4 minutes 20 secounds”
6 End time String “mmmm:ss

 


id3v2.3

 

Main header

At the beginning of the file
Size
(bytes)
Name
(type)
 3 Identifier
(String)
$54 41 47
(“TAG”)
 2 Version $03 00
(“v3.00”)
 1 Flags %abc00000
  •  a   Unsynchronisation (padding w “$00”)
  •  b   Extended header
  •  c   Experimental indicator
 4 Header size 4 bytes “%0×××××××”, for a total of 28 bits.

Size of id3v2 tags block, excluding header block.

Extended header

Attached to the header block if the Extended Header bit is set
Size
(bytes)
Name
(type)
 4 Header size Usually 6 or 10, excluding self
 2 Flags Binary: “%x0000000 00000000
  •  x   CRC data present
 4 Padding size

 


Frame header

Separate from file header, and therefore subject to unsynchronisation
 4 Frame name String, [AZ] + 3×[AZ09]
Names starting with [XYZ] are experimental
4 Header size Size of data block
2 Flags %abc00000 ijk00000
  •  a   Tag alter preservation
  •  b   File alter preservation
  •  c   Read-only
  •  j   Compression
  •  k   Encryption
  •  l   Grouping identity
  Data block

 


Frame types

Text frame

Frame type “T×××” (excluding “TXXX”)
1 Text encoding
  • 00   ISO-8859-1
  • 01  
  • 02  
  • 03   Unicode: UTF-8
Text

 


Picture

Frame type APIC
 1 Text encoding
MIME type Text string (null-terminated)
1 Picture type
  •  0   (other)
  •  1   32x32 pixels “file icon” (PNG only)
  •  2   Other file icon
  •  3   Cover (front)
  •  4   Cover (back)
  •  5   Leaflet page
  •  6   Media (e.g. lable side of CD)
  •  7   Lead artist/lead performer/soloist
  •  8   Artist/performer
  •  9   Conductor
  •  A   Band/Orchestra
  •  B   Composer
  •  C   Lyricist/text writer
  •  D   Recording Location
  •  E   During recording
  •  F   During performance
  • 10   Movie/video screen capture
  • 11   A bright coloured fish
  • 12   Illustration
  • 13   Band/artist logotype
  • 14   Publisher/Studio logotype
Description Text string (null-terminated)
Picture file

 


Private frame

Identifier Text (null-terminated)
Data

 


…misc…

Unsynchronization

Add null after “$ff”;

%11111111 111×××××”   →   “%11111111 00000000 111×××××

First intended to only add null between $ff and %111×××××, but $ff 00 appears to have padding, and therefore needs to actually have one.

$ff 00”   →   “$ff 00 00

 


id3v2.4

AFAICT, this is basically an extension to the fields and their contents. This document concerns mostly how these fields are wrapped externally. Mostly.

In the event of a proper excursion into the internals of those fields, that will be in the form of this document being in two parts.

 


Links