[Flac] frames number & compression level

Brian Willoughby brianw at sounds.wa.com
Tue Jan 27 14:11:23 PST 2009


FLAC uses the same data format regardless of compression level,  
therefore the compression level is not needed to decode the data.  It  
is only of interest to humans who are curious. ;-)

Basically, when you specific a compression level, you are telling the  
encoder how hard to work.  The decoder does not need to know how hard  
the encoder worked.  All the decoder needs to do is decode one data  
format which is the same for all compression levels.  In fact, as the  
encode is improved, there may be more compression levels in the  
future, or the existing levels may change, or the levels may become  
more fine-grained.  In other words, there's no finite way to  
precisely express the compression level which would not eventually  
become invalid.  Perhaps this explanation shows you why there is no  
compression level stored in the file.

You can always calculate the percent reduction in size due to  
compression, but mapping that to the original command line is not  
precise.

Brian Willoughby
Sound Consulting


On Jan 27, 2009, at 08:04, Santiago Jimeno wrote:

If compression level  is not default (!=5), is it stored?
If compression level  is stored in some case, where I can find it?

----- Original Message -----
From: "Josh Coalson" <xflac at yahoo.com>
> --- Santiago Jimeno <sjimeno at ya.com> wrote:
>> I am making a program to obtain information from FLAC files in Visual
>> Basic. NET language.
>> If somebody needs it I can send it. I can also translate it to C #.
>> But I have read the documentation and I have looked for in sdk 1.2.2
>> and I don't find how to get the frames number of the file and the
>> used compression level (5 default and others)
>
> compression level is not stored by default.  if the stream is fixed
> blocksize (min and max blocksize in the streaminfo is the same) the
> total number of frames can be calculated by dividing the number of
> samples (also in streaminfo) by blocksize.
>
> http://flac.sourceforge.net/format.html#metadata_block_streaminfo



More information about the Flac mailing list