Help - Search - Members - Calendar
Full Version: Picture tag/block padding
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
Waywisher
Hi,

Can someone explain to me how the FLAC picture tag/block is handled?

I was under the impression that the picture tag was written at the front of the file and therefore if the picture was bigger than the space/padding already there the file would need to be re-encoded. I’ve ripped a number of CDs using EAC to FLAC using the compression command

-8 -V -T "artist=%a" -T "title=%t" -T "album=%g" -T "date=%y" -T "tracknumber=%n" -T "genre=%m" -T comment="%e" -T "comment=Extracted from CD using EAC" %s

I’ve then been playing with MediaMonkey 3 which seems to have no problem adding the art to the picture tag.

The command above doesn’t include any picture padding (does it?) – So does FLAC have a default amount of space allocated for the picture tag, or how is MediaMonkey adding the art?

Thanks in advance!

perilsensitive
QUOTE(Waywisher @ Apr 22 2008, 13:37) *

I was under the impression that the picture tag was written at the front of the file and therefore if the picture was bigger than the space/padding already there the file would need to be re-encoded.


Yes, the picture block (and all other metadata) is written to the front of the file. However, the file does not need to be re-encoded if you add metadata that doesn't fit in the currently allocated blocks (including padding).

All that happens is that the program (MediaMonkey in your case) makes room for the new block by adding space to the end of the file and moving the audio data down to fill that new space. As a result, there is now enough room at the front of the file for the new block.

QUOTE

The command above doesn’t include any picture padding (does it?) – So does FLAC have a default amount of space allocated for the picture tag, or how is MediaMonkey adding the art?


Flac doesn't allocate any space for the picture block, but it does allocate padding by default: 64K if the audio data is more than 20 minutes long, 8K otherwise. You can change the size of the padding by passing '-P X' (replace X with the size of the padding in bytes) to flac when encoding. You can also add or delete padding with the metaflac command after you've already encoded.
Waywisher
Excellent, thanks - I guess I can go ahead and add all the art!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.