Let’s say you have a new music system and you want to rip all your music to FLAC to take advantage of your high-quality setup. One of the most important considerations is which FLAC compression level you should choose. On the other hand, maybe you are ripping your music to archive them. Which FLAC level should you choose? In this article, we explain FLAC compression levels and help you choose the best option for your needs.
What Are FLAC Compression Levels?
FLAC is short for Free Lossless Audio Codec which means there is no loss of quality. It is a popular open-source lossless compression file format that offers CD-quality audio sound at half the size. FLAC offers varying levels of lossless compression from 1 through to 8.
What are these compression levels?
Well, FLAC compression levels determine the file size of the compressed file. When FLAC files are compressed, there is no loss of quality because FLAC will always decode into the exact uncompressed audio track down to every single bit.
The only difference between the compression levels is the resulting file size. With other compression methods, such as MP3, various aspects of the files are stripped out to save space. Check out our article on MP3 vs FLAC.
However, the disadvantage of using high FLAC compression to save space is that the compression will take longer. The more space you save, the longer the compression process will take.
FLAC Example Compression
Many theoretical literature will tell you that there should be no noticeable difference with the decoding process when decoding FLAC files at different FLAC levels. However, is this true?
We ran a test to check this out. Firstly, we ripped the song into an uncompressed WAV file and then encoded it into FLAC using the following command from the command line:
time flac $TESTSONG.wav –compression-level-X -o flacX.flac
This particular command will show the time to encode. All you need to do is to substitute X for the compression level number (0 to 8 level compression).
Here are the system specs:
- Level: The FLAC compression level used
- Encode (sec): The time it took to encode the song
- Size (MB): The size of the resulting FLAC file
- Encode Time (vs FLAC 0): The additional time required to encode as compared to FLAC 0 (in seconds)
The tables below show the comparisons of the two songs and the resulting performance after the complete process:
|FLAC Level||Encode Time (sec)||Size (MB)||Encode Time (vs FLAC 0)|
From the above, we notice the following:
- The best FLAC compression level with the best trade-off between file size and additional encoding time is FLAC 3, 4, or 5.
- FLAC 0 to 2 encode very fast, but the file sizes are quite large.
- FLAC 6 to 8 takes a long time to encode, but the file sizes are very small.
- The difference between FLAC 0 and FLAC 3 in terms of size is very small. As such, you could rip your music in FLAC 0 if you have space. Let’s say you have 100 hours of music that will consume
Should I Use A High or Low FLAC Compression?
Firstly, any FLAC compression level you chose, from FLAC 0 to 8 will save you a lot of space. However, you may not want to use a high FLAC compression level to compress say your music.
This is because when music files are compressed, they must be decompressed on the fly during playback.
At higher compression levels, your PC or music player must do more work to decompress the file. If you are on a mobile phone, for example, this means less battery life.
Should I Use Mid Level or High FLAC Compression?
The difference between mid-level and high-level compression e.g FLAC 5 vs FLAC 8 is that the higher levels will take much longer to compress.
FLAC 8 will typically take 3 times as long to compress a song as FLAC 5, however, the difference in file size will be negligible.
As such, it really comes down to the compromise you are willing to make. In addition to taking longer to compress, higher level compression FLAC files will also take longer to decode at playback.
Why Should You Use FLAC 3 to 5 For Compressing Music
FLAC 5 is the default compression level for a good reason. This level of compression is the optimal balance between file size reduction and playback performance.
However, anywhere between FLAC 3 to 5 is normally a good compromise as indicated by the test aboves.
Your choice of FLAC compression level should really depend on your intended use. If you have a lot of space or you are archiving, you can use a low compression level like FLAC 0. However, if you are going to be playing your music on a mobile device with limited space and processing power. go for a mid-level compression where it doesn’t require a lot of processing power to decode, but the file sizes aren’t large. In this case, FLAC 3 to 5 should be OK. FLAC 6 to 8 are really for persons who have the processing power to easily decode these files on the fly but are keen on saving space.