IPB

Welcome Guest ( Log In | Register )

What differences among CUETools outputs? libFlake/libFLAC/flake/FLACCL, Moderationóderailed into a verbose discussion about compression levels
pinkfloydeffect
post Mar 24 2012, 23:41
Post #1





Group: Members
Posts: 17
Joined: 2-March 12
Member No.: 97516



I have some audio FLAC CDs in single track format with a CUE file. I read the best way to split up the tracks is with CUETools, but I don't know which audio output (encoder?) to use. There are four options:

libFlake, libFLAC, flake & FLACCL

Can anyone explain what the difference(s) are please?

Thanks!
Go to the top of the page
+Quote Post
 
Start new topic
Replies
Chinch
post Mar 27 2012, 11:08
Post #2





Group: Members
Posts: 98
Joined: 22-July 09
Member No.: 71664



Exactly. So here is to sum up what everyone has said about your questions:

1. Compression has nothing to do with audio quality in a FLAC file or any lossless file format like it does with a lossy format such as MP3/AAC (aka M4A). Whether you use level 0, or level 8... the output (whether decoded in real-time as you are listening to the music, or decoding it back to a WAV file, etc) will be exactly the same. Compression ONLY has to do with two factors... a) the amount of hard drive space the encoded FLAC file will take up (if you would like to save as much HD space as possible, then always choose level 8) and b) how much resources will be consumed, most often considered are the playback/real-time resource usage, since the greater the compression of the FLAC file, the more CPU/memory it is likely to use when you are PLAYING that file. When you are decoding to a WAV file... it's likely your hard drive is the bottleneck rather than the CPU. Same goes for real-time decoding -- if your system has trouble decoding audio to the point where it can't keep up with decoding 1 (listening) second of audio before your audio player is ready to play that second or those fractions of a second, then it's time to upgrade. If your machine is fast like you said, then I personally recommend using compression level 8, the max in the reference or "official" FLAC encoder.

2. Once again, they mentioned that FLAC is a lossless format... and you're not going to do anything to make it LOSSY unless you're converting from a LOSSY SOURCE such as MP3's or AAC files. As long as you're encoding from another lossless format, such as Apple Lossless (ALAC) or WAV... which is the uncompressed form of the lossless audio, you will suffer no quality loss. Even decoding a FLAC file to a WAV file, then back to a FLAC file with greater compression will not cause audio loss.

There is a super simple way to prove this. If you know how to create a checksum or a checksum file (such as a SFV, MD5 or SHA-1 file/file hash) then grab a WAV file, get make a checksum of it, then encode the WAV to FLAC using any compression level you want. Now delete the original WAV file. Decode the FLAC file right back to WAV (thus re-creating the original WAV file... which should be identical. Check the newly decoded WAV file with the original WAV file's checksum value. It should match. I'm not going to go into super detail about anything that could cause them not to match but still be the same audio data... because they're rare cases, and they're the exception rather than the rule. Also, each FLAC file, once encoded, has a built-in MD5 "fingerprint" or checksum value. This is calculated considering ONLY the decoded/original audio stream, and EXCLUDES metadata (tags, embedded art, etc) or any other non-audio data. Therefore, you can change the file's tags, etc and even re-encode it, and this MD5 should remain the same.

So here's my proof process. I open up foobar2000, load up a random FLAC file. Then I go to the file's properties, and take a screenshot of it. A few very important values to note. 1) filesize 2) total length (or more importantly, total SAMPLES) 3) MD5 checksum of the audio

Before screenshot, I have no idea what compression was used on this file, etc... it doesn't matter. This is the file's properties, still in FLAC format, the way I found it:



Then, I decode the FLAC file to a WAV file. Next, I arbitrarily choose a compression level of "2"... because it's... well... random enough... then I re-encode the WAV file with the new compression level. Take a look at the end results in the "after" screenshot:



You will notice three important things... 1) the second (re-encoded) file size is LARGER than the original one.. meaning it was originally compressed using greater than level 2 compression, since it's approximately 2MB bigger... BUT at the same time, you'll notice that it is the EXACT same length (both time and samples are identical)... AND the MD5 checksum of the audio stream is identical, even though they have two differing file sizes! This proves that the audio has not changed by a single sample; thousands of a second... furthermore... I used foobar2000's Binary Comparator (I can't recall if it is stock or an add-on, sorry)... but this compares the exact same thing... it disregards any NON-AUDIO data, and compares ONLY the audio within both files. I compared the original FLAC file, with the re-encoded (larger) FLAC output file, with the same results... identical files, no differences found:

All tracks decoded fine, no differences found.
Comparing:
FILE1.FLAC
FILE2.FLAC
No differences in decoded data found.



3. My personal recommendation, and this is only because I have a fast machine with plenty of memory, and ENCODING speed (the very first compression) nor the DECODING speed (decompressing the samples as it plays the audio, plus a little ahead of what you're listening to, which is buffered...) is an issue to me. Therefore, when encoding, I always use two parameters. Those are -8 for maximum compression (I would rather the encoding take a little bit longer and save a little bit more hard drive space than vice versa), since I already run a tight ship there, haha... and although some may argue against its worth; the fact of the matter is that it can't do any HARM (other than consume a few more CPU cycles) is the -V or VERIFY switch/parameter... which encodes a bit of audio, then immediately turns back around and decodes it... then compares it to the source file (either in memory still or on disk) -- if everything jives, then you know there was no type of corruption or errors during the encoding process. It's one of those "paranoid" things that OCD freaks like me do... haha...

4. To me, another important thing... and this is, again, purely preference and will be subjective... but I prefer to rip my CD's in EAC using the COPY AND TEST IMAGE + CUE FILE option. Either option you use, by proper ripping standards, you have GOT to make sure that you are using the proper offset for your specific CD drive, which should have been auto-configured for you by EAC upon first use. This may cause cutoff at the start of a track; most obviously not at the very start of the CD or end... but in the MIDDLE of two seamless/gapless tracks where one goes right into the other with no pause whatsoever... this would be if you were doing track-by-track and reading each track by its own offset. If you have a large offset margin, and it happens between two seamless tracks, you're not going to notice the missed audio-- but it COULD reveal itself as a POP or CLICK in the transition... (which is caused by two points of a waveform not aligning to a zero-boundary, and the sudden shift between two differing dB/amplitude levels caused by misalignment... in this case, missing samples)... If you were ripping the disc as a SINGLE IMAGE... you wouldn't experience this, your whole image would just be shifted <- or -> whatever the missing offset correction was. Since there's padding before and after the first/last tracks, then an offset that is so tiny will only likely ever matter when comparing to the AccurateRip database... MAYBE.

For instance, my drive's offset is +6 samples. A standard audio CD plays at 44,100 samples per second (1 second = 1 frequency cycle, aka "period" = 1Hz). In my case, that 6 sample offset error is, in reality, equal to a fractional 1/7,350ths of 1 second, reduced... if these missing samples occur during an already silent/null/zero'd area of the disc/audio, such as the very first or very last samples of the data.


This is probably far more information than you were looking for, but maybe it'll be helpful to someone else... there are tons of very smart people reading these forums, and they are very curious to learn the fine details, most of them... so I don't know if there's always such a thing as "too detailed" or explaining something to greater levels than the original question may have asked for. I know, myself, I will ask a question that isn't asking for much detail... but simply because I am not AWARE of what details there are to such a subject. In other words, sometimes I don't know the correct questions to ask, if I don't know the depth of topic, right?

I can't begin to ask someone about low-level functionality of say, a video card... if I don't know how the bus handles the data to form/renders images, etc! You read as far as you can understand.. and there'll be a point where it stops making full sense usually... but you've learned a little more than you knew before... and the next thread that goes into detail, you'll understand more of it than you would have.... blah blah. It's all progressive learning, you learn this crap in tiers, (and if you learn it from me, likely in tears)... I'll end my formal write-up there. I'm sure it's more than you ever cared to know... but-- if you do want to know more... that's what these people are all here for... to learn and to teach... ass-hoppah!

NO difference between compress 1 and compress 8 for quality! GO! flaCUDA uses video card GPU on nVIDIA-based cards to speed up encoding. It proprietary though! Not for ATI! Flake and other ... experimental re-codings of original FLAC encoder/decoder. Done for fun/hobby. One by CUETOOLS creator... maybe both. Could be bugs, non-standard problems. I would stick with reference encoder, always. Speed is nice, but encoding glitches and errors, NOT nice... fu.. whoops. Almost drop F bomb there LOL... they mess up audio possibly!!@! This audio, not identical to original! Big problem!!! Hope you enjoy learning from my offerings. If not, my apologies to all. Have fantastic days today, everyone.

P.S. Two very minute bits of info I omitted...

When I rip the audio CD's to a single WAV file, I then turn around and encode that single WAV file to a single FLAC file, and embed the CUE sheet into the FLAC tag. This provides all of the correct indices for track identification (as well as lead-in's or INDEX 00's)... it includes essentially the full original disc's exact layout, within that 1 file... as well as the album art, titles, etc. In essence, I have 1 file per album that contains everything embedded within it to decode it and write back a 100% perfect copy of the original. This is my preference. Most people just haphazardly rip to 1-FLAC-per-TRACK, and don't ever save the CUE sheet or the LOG file from their rip/encode, as I've seen out in the wild. That sucks for me because the funny part is, when I'm looking for these albums, I'm not interested in the audio files... I already have them. I often want to get a different copy of the CUE sheet or log file from someone else's rip to address some rare anomaly or double check something that seems odd to me... and they never include the things. I may be one of the few people who are disappointed that they included audio files.... I just want the text files to compare! Regardless, this way... TO ME... IMO... is the ideal way to package my digital copies of my CD's. As said, though... it's all preference... so no fights necessary about which is "best".

Second, as far as compression ratios go... just for your reference/curiosity... most album WAV files that I compress at level 8 (max) hit an average of about a 30% reduction in file size vs. the original. So most of them end up being just 70% the size of their original, uncompressed sources... with NO LOSS of audio, whatsoever. You've gotta love lossless compression... it's one of the few scenarios where you can literally get "something for nothing"... (but no chicks for free... sorry). In fact, if chicks hear you talking about any of this stuff, you won't be getting chicks for free, OR with a major credit card, even... unfortunately discussing the dynamics of lossless audio compression algorithms does NOT get them hot and bothered. It just gets them bothered. LOL. We all know that already, though. wink.gif



This post has been edited by Chinch: Mar 27 2012, 11:32
Go to the top of the page
+Quote Post

Posts in this topic
- pinkfloydeffect   What differences among CUETools outputs? libFlake/libFLAC/flake/FLACCL   Mar 24 2012, 23:41
- - pablogm123   Check these links: www.cuetools.net/wiki/CUETools...   Mar 25 2012, 02:19
- - Porcus   QUOTE (pinkfloydeffect @ Mar 24 2012, 23...   Mar 25 2012, 02:25
- - pinkfloydeffect   Thanks guys! I'm not worried about speed I...   Mar 25 2012, 02:40
|- - Kohlrabi   QUOTE (pinkfloydeffect @ Mar 25 2012, 02...   Mar 25 2012, 03:12
|- - pinkfloydeffect   Wait...so my FLAC audio player extracts the song f...   Mar 25 2012, 04:06
|- - GenjuroXL   QUOTE (pinkfloydeffect @ Mar 25 2012, 05...   Mar 25 2012, 09:20
|- - lvqcl   QUOTE (pinkfloydeffect @ Mar 25 2012, 07...   Mar 25 2012, 10:34
- - pablogm123   I own a very ancient PC (A secondary retro PC I bu...   Mar 25 2012, 10:55
- - pinkfloydeffect   I see I see, is this why when I open FLAC files in...   Mar 25 2012, 17:55
|- - Dario   QUOTE (pinkfloydeffect @ Mar 25 2012, 18...   Mar 25 2012, 22:38
|- - pinkfloydeffect   Thanks! So either way it's not about quali...   Mar 25 2012, 22:50
|- - Porcus   QUOTE (pinkfloydeffect @ Mar 25 2012, 22...   Mar 26 2012, 07:24
|- - pinkfloydeffect   Thank You   Mar 27 2012, 04:57
- - pinkfloydeffect   ALSO, the bar above "Go' that says 0-8 is...   Mar 25 2012, 22:28
- - tpijag   once again, lossless is lossless. Before getting t...   Mar 25 2012, 22:57
- - pablogm123   QUOTE "and foobar seems to "fade" t...   Mar 25 2012, 23:17
|- - pinkfloydeffect   It seems to run pretty fast in level 8 for me, I h...   Mar 25 2012, 23:35
- - pablogm123   You can get better perfomance if you use a convert...   Mar 25 2012, 23:47
- - Chinch   Exactly. So here is to sum up what everyone has sa...   Mar 27 2012, 11:08
|- - Porcus   QUOTE (Chinch @ Mar 27 2012, 11:08) the g...   Mar 27 2012, 11:31
|- - Chinch   QUOTE (Porcus @ Mar 27 2012, 06:31) QUOTE...   Mar 27 2012, 17:40
|- - Porcus   QUOTE (Chinch @ Mar 27 2012, 18:40) I...   Mar 27 2012, 20:31
|- - Chinch   I see, this is can meet more with you on. Definite...   Mar 27 2012, 21:26
|- - Porcus   QUOTE (Chinch @ Mar 27 2012, 22:26) I was...   Mar 27 2012, 22:40
|- - Chinch   Since you are a foobar2000 user, I am making the g...   Mar 28 2012, 04:56
- - pinkfloydeffect   Wow those are some lengthy detailed posts there Ch...   Mar 28 2012, 03:38
- - Porcus   Re your concern about a newer FLAC build; I knew I...   Mar 29 2012, 08:24
|- - pinkfloydeffect   QUOTE (Porcus @ Mar 29 2012, 03:24) Re yo...   Mar 29 2012, 23:23
|- - Porcus   QUOTE (pinkfloydeffect @ Mar 30 2012, 00...   Mar 31 2012, 14:28
- - Elias Pies de Plomo   Hello guys, I've been reading your posts as I ...   May 4 2013, 16:27
|- - belli   QUOTE (Elias Pies de Plomo @ May 4 2013, 16...   May 7 2013, 07:05
- - Wombat   QUOTE (belli @ May 7 2013, 08:05) QUOTE (...   May 7 2013, 15:09
|- - belli   QUOTE (Wombat @ May 7 2013, 16:09) QUOTE ...   May 7 2013, 21:21
|- - Gregory S. Chudov   QUOTE (belli @ May 7 2013, 16:21) Flake, ...   May 9 2013, 04:06
- - Wombat   QUOTE (belli @ May 7 2013, 22:21) Flake, ...   May 7 2013, 21:36
|- - belli   QUOTE (Wombat @ May 7 2013, 22:36) QUOTE ...   May 8 2013, 08:17
- - Wombat   I also tried latest 2.1.5 because i am still with ...   May 9 2013, 15:19
- - Gregory S. Chudov   I think the difference in size is just padding. CU...   May 9 2013, 16:47


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th September 2014 - 07:18