Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: FLAC Compression ratios (Read 19131 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FLAC Compression ratios

Hi all,

When running the FLAC encoder from different applications on the same file, I get different compression rations. The FLAC front-end gives the best results (batch conversion from WAV), followed by CDex (CD ripping to FLAC), then foobar2000 (batch conversion from WAV). The original WAV file was previously ripped to WAV with CDex.

Running decode from the front-end results in 3 identical files, all identical to the original ripped WAV file, at least in terms of size.

The configured compression level is always 8. I only have 1 copy of flac.exe throughout the entire system (XP).

Any idea why this happens?

Many thanks in advance.

JJ


FLAC Compression ratios

Reply #2
Are you comparing the actual bits per second of the audio data, or just the overall size of the FLAC files?

There could very well be differences in how each application tags the resulting FLACs, and that would make a difference in the overall file size.  For instance, by default, FLAC frontend doesn't add any tags, and would therefore produce the smallest file size possible for a given compression ratio.

Edit: 2 minutes!  What greynol said.
"Not sure what the question is, but the answer is probably no."


FLAC Compression ratios

Reply #4
Thanks all,

I was comparing the raw file sizes, which are significantly different.

I will investigate further in the light of your answers and of the existing topic.

J-J


FLAC Compression ratios

Reply #6
Well, I've sorted out the situation with foobar (my output parameters were wrong), and these are the results I now get for a given file:
- WAV - 1411 Kbit/s - 45 840 524 bytes (for reference)
- FLAC from Front-end (batch conversion) - compression level: 8 - 512 Kbit/s - 16 643 150 bytes
- FLAC from foobar (ripping) - compression level: 8 - 512 Kbit/s - 16 636 729 bytes
- FLAC from CDex (ripping) - compression level : 8 - 558 Kbit/s - 18 138 714 bytes
- FLAC from Front-end (batch conversion) - compression level: 2 -559 Kbit/s - 18 167 598 bytes
- FLAC from foobar (batch conversion) - compression level: 8 - 694 Kbit/s - 22 554 703 bytes
- FLAC from Front-end (batch conversion) - compression level:0 - 587 Kbit/s - 19 074 076 bytes

Those results are somewhat mysterious to me, but thet are perfectly deterministic (i.e. repeatable), and all the FLAC files can be converted back to the original WAV size.

Rather than investigating for ages, I will now use foobar for ripping, and the front-end for batch conversions.

Thanks all.

JJ

FLAC Compression ratios

Reply #7
Why wouldn't you use foobar for batch conversions too?

Personally I would use dbp for ripping.

FLAC Compression ratios

Reply #8
Well, using foobar for batch conversions yields the worst possible results (see my figures).

With regard to dbp, I never heard of it before. Have you got a link, please?

Thx.

FLAC Compression ratios

Reply #9
Sorry pdq, I just realize you were talking about dBpoweramp.

Thank you

FLAC Compression ratios

Reply #10
Quote
- FLAC from foobar (ripping) - compression level: 8 - 512 Kbit/s - 16 636 729 bytes
- FLAC from foobar (batch conversion) - compression level: 8 - 694 Kbit/s - 22 554 703 bytes

I just ripped (converted a random CDDA track to WAV and to FLAC -8) using foobar2000 1.1.2 beta 4 and then converted the resulting WAV file to FLAC -8.  The two FLAC files are exactly the same size.

Do you have some kind of processing enabled in your foobar2000 conversion settings?

FLAC Compression ratios

Reply #11
In Foobar2000, are you keeping the lossless sources at the same bit depth, and are you applying dither?

If you are applying dither, then the FLAC encodings will obviously be at a higher bitrate because of the added dither.

In my Foobar 2000 settings, I have Preferred Bit Depth set to "16", Dither "never", and the Keep Lossless Sources at Original Bit Depth box checked.

With this, and making sure that Foobar is using the same flac version as all my other encoding apps, the same WAV files produce the exact same size files (give or take a few hundred bytes due to tags) in all applications.

FLAC Compression ratios

Reply #12
@Apesbrain
I can't find any specific settings for conversion. Where are they? By the way, I use v1.1.1, in case this might be a problem.
@Wonderslug
My settings don't look like yours. I have indeed chosen a 16-bit depth, but Dither is only a check box (unchecked) and I don't have a box called "Keep Lossless sources at Original Bit Depth". Mybe a version problem too?
Thx.

FLAC Compression ratios

Reply #13
I forgot to mention I'm not willing to upgrade to v1.1.2 beta 4, because this will expire after 4 weeks (unless I misinterpreted something).

FLAC Compression ratios

Reply #14
Perhaps you could strip out all of the tag metadata with mp3tag and then compare the file sizes again?  That way the old data left in the file is audio data.

FLAC Compression ratios

Reply #15
Of course, this could be done. But, as stated by WonderSlug, metadata should be no more than a few hundred bytes. And, as you may have noticed, the big differences I experience are due to the varying bit rates of the encoded streams. Therefore, as the other contributors rightly point out, I must have a problem with foobar (and CDex) parameters, but I'm unable to track it down right now.

FLAC Compression ratios

Reply #16
Of course, this could be done. But, as stated by WonderSlug, metadata should be no more than a few hundred bytes. And, as you may have noticed, the big differences I experience are due to the varying bit rates of the encoded streams. Therefore, as the other contributors rightly point out, I must have a problem with foobar (and CDex) parameters, but I'm unable to track it down right now.

You have a difference of about 1.4MB - could it be a jpeg or something in the tag?  With mp3tag you can examine the extended tags to see exactly what is in the file metadata.

FLAC Compression ratios

Reply #17
Of course, this could be done. But, as stated by WonderSlug, metadata should be no more than a few hundred bytes. And, as you may have noticed, the big differences I experience are due to the varying bit rates of the encoded streams. Therefore, as the other contributors rightly point out, I must have a problem with foobar (and CDex) parameters, but I'm unable to track it down right now.

You have a difference of about 1.4MB - could it be a jpeg or something in the tag?  With mp3tag you can examine the extended tags to see exactly what is in the file metadata.

The difference is very nearly 6 MB (16,6 vs 22.6 MB). I will take a look at the tags and keep u posted if I find anything. But we are talking about a CD track, ripped to FLAC directly, or ripped to WAV then converted to FLAC. Where would 6 MB of tags come from? I'm puzzled...

FLAC Compression ratios

Reply #18
Of course, this could be done. But, as stated by WonderSlug, metadata should be no more than a few hundred bytes. And, as you may have noticed, the big differences I experience are due to the varying bit rates of the encoded streams. Therefore, as the other contributors rightly point out, I must have a problem with foobar (and CDex) parameters, but I'm unable to track it down right now.

You have a difference of about 1.4MB - could it be a jpeg or something in the tag?  With mp3tag you can examine the extended tags to see exactly what is in the file metadata.

The difference is very nearly 6 MB (16,6 vs 22.6 MB). I will take a look at the tags and keep u posted if I find anything. But we are talking about a CD track, ripped to FLAC directly, or ripped to WAV then converted to FLAC. Where would 6 MB of tags come from? I'm puzzled...


My guess is that you are applying dsp effects when converting files, but not when ripping.

FLAC Compression ratios

Reply #19
Of course, this could be done. But, as stated by WonderSlug, metadata should be no more than a few hundred bytes. And, as you may have noticed, the big differences I experience are due to the varying bit rates of the encoded streams. Therefore, as the other contributors rightly point out, I must have a problem with foobar (and CDex) parameters, but I'm unable to track it down right now.

You have a difference of about 1.4MB - could it be a jpeg or something in the tag?  With mp3tag you can examine the extended tags to see exactly what is in the file metadata.

The difference is very nearly 6 MB (16,6 vs 22.6 MB). I will take a look at the tags and keep u posted if I find anything. But we are talking about a CD track, ripped to FLAC directly, or ripped to WAV then converted to FLAC. Where would 6 MB of tags come from? I'm puzzled...


My guess is that you are applying dsp effects when converting files, but not when ripping.

This is a worthwile guess, but I don't know how to configure dsp effects for ripping vs converting.
In any case, I don' have any dsp's enabled under Preferences > Playback > DSP Manager.
Are there any other locations to look at?

FLAC Compression ratios

Reply #20
For foobar 1.1:

Select track in foobar; right click to bring up context menu; Convert; "..."; Processing; then make sure that the Active DSPs box is empty....
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

 

FLAC Compression ratios

Reply #21
Quote
then make sure that the Active DSPs box is empty....

and "Additional decoding" is off. (added: you will see it only if you have foo_hdcd or foo_input_dts installed).

Added 2: ...and replaygain is off, too.

FLAC Compression ratios

Reply #22
and "Additional decoding" is off.
Oops....
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

FLAC Compression ratios

Reply #23
Thanks, gentlemen, that was it.
But why the hell are conversion parameters identified by"..." in the context menu?????
This is not intuitive, to say the least.
Thanks again anyway.
JJ

FLAC Compression ratios

Reply #24
I forgot to mention I'm not willing to upgrade to v1.1.2 beta 4, because this will expire after 4 weeks (unless I misinterpreted something).

By that time, there will either be a new beta or the final version. That's how they handle development/releases.