Newbie question "How long is id3v2 tag?"

I see some online info on id3v2 such as http://www.id3.org/id3v2.4.0-structure.txt, however, I cannot figure out how long id3v2 tag is (id3v1 is too easy.)

The document says the header reads

 ID3v2/file identifier      "ID3"
 ID3v2 version              $04 00
 ID3v2 flags                %abcd0000
 ID3v2 size             4 * %0xxxxxxx

Looking at actual mp3 files, I can see id3v2 identifier (ID3) and ID3v2 version, but I cannot understand id3v2 flags and size, especially %abcd0000 and 4 *%0xxxxxxx part.

Will anyone help me?

Thanks in advance!

Maybe you should have a look at the implementations on the same site: http://www.id3.org/implement.html or the open-source-library on http://id3lib.sourceforge.net/

This site http://getid3.sourceforge.net/ offers a downloadable php-project and a forum. :wink:

Mp3tag has placeholders for tag sizes you can use in the columns:
$div(%_tag_size%,1024)kb (%_tag_size_prepended%/%_tag_size_appended%)

ID3v2.4 Info:
You should read these parts closely from id3v2.4.0-structure.txt:
2. Conventions in this document
3.1. ID3v2 header
6.2. Synchsafe integers

A small example (I hope it's correct)

Header:
$49 $44 $33 | $04 $00 | $80 | $00 $00 $10 $77

Decode Flag Byte: (from hex to binary)
$80 -> %10000000 : Bit a - Unsynchronisation

Decode Tag size Bytes:
$10 $77 - > %1000001110111

10000 | 01110111 : remove Bit 7
        ^
->
 1000 | 01110111

%100001110111 -> 2167
Tag size: 2167 Bytes
QUOTE (dano @ Sep 24 2006, 16:11) <{POST_SNAPBACK}>
Mp3tag has placeholders for tag sizes you can use in the columns:

$div(%_tag_size%,1024)kb (%_tag_size_prepended%/%_tag_size_appended%)

ID3v2.4 Info:
You should read these parts closely from id3v2.4.0-structure.txt:
2. Conventions in this document
3.1. ID3v2 header
6.2. Synchsafe integers

A small example (I hope it's correct)

Header:
$49 $44 $33 | $04 $00 | $80 | $00 $00 $10 $77

Decode Flag Byte: (from hex to binary)
$80 -> %10000000 : Bit a - Unsynchronisation

Decode Tag size Bytes:
$10 $77 - > %1000001110111

10000 | 01110111 : remove Bit 7
        ^
->
 1000 | 01110111

%100001110111 -> 2167
Tag size: 2167 Bytes<!--QuoteEnd--></div><!--QuoteEEnd-->

Sorry for bumping an old post. But you are a life saver! Thank you so much for this. It helped a lot. I wish you could rep people on this forum.