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: Finding out the Compression Level of FLAC Files on Ubuntu (Read 10659 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Finding out the Compression Level of FLAC Files on Ubuntu

Do you know how (or with which program) it'd be possible to find out or see the compression level (from 0 to -8) of a FLAC file? If my memory serves me right, there were several ways to see the compression level used in a FLAC file on Windows but nowadays I use Linux (Ubuntu) and thus far I haven't been able to find any way of seeing/verifying the compression level on this operating system.

In terminal the command "flac -a [filename]" gives you quite a deep analysis of the file but it doesn't reveal the compression level and even though it e.g. displays bits per each frame, I can't really infer anything from them (at least anything that would be related to those compression levels).

It'd be great if you were able to point me to some Ubuntu-compatible tool/program with which I could analyze FLAC-files and find out the compression level (from 0 to -8).

I have already started a thread about this problem here (in Finnish) http://keskustelu.suomi24.fi/node/8162657 but they haven't been able to help me there yet and they simply suggested that I submit the same questions on this forum.

Finding out the Compression Level of FLAC Files on Ubuntu

Reply #1
This info isn't stored in the file or tags AFAIK. See here for some discussion.

Edit: You can always store this info manually in a tag, but as the compression implementation can change between versions and flac is lossless, does this info serve any real useful purpose?

Finding out the Compression Level of FLAC Files on Ubuntu

Reply #2
You can try compressing it to -8 and if the new file is the same size, then great.  On my computer, compressing takes about 15sec per song.

Finding out the Compression Level of FLAC Files on Ubuntu

Reply #3
According to http://lists.xiph.org/pipermail/flac/2007-July/000933.html compression level is not stored in FLAC file, only in comments if the encoder (but command line flac encoder doesn't do this) will put it there. Probably you have seen encoder command line like "FLAC -8" in FLAC's comments as I did many times. A compression level consists of settings for different subencoders of FLAC and may vary from one encoder implementation to another. Probably a compression level can be derived by some heuristic search over such settings inside the file, but I never came across a tool that is doing this search... One way to do this is to recompress the file at different comression levels and compare compressed streams sizes, you can even write a script for doing this through a binary search doing 4 compressions at most instead of 8...
Also, according to "flac --help" compression levels are just equivalent to a bunch of settings:
Code: [Select]
  -0, --compression-level-0, --fast  Synonymous with -l 0 -b 1152 -r 3
  -1, --compression-level-1          Synonymous with -l 0 -b 1152 -M -r 3
  -2, --compression-level-2          Synonymous with -l 0 -b 1152 -m -r 3
  -3, --compression-level-3          Synonymous with -l 6 -b 4096 -r 4
  -4, --compression-level-4          Synonymous with -l 8 -b 4096 -M -r 4
  -5, --compression-level-5          Synonymous with -l 8 -b 4096 -m -r 5
  -6, --compression-level-6          Synonymous with -l 8 -b 4096 -m -r 6
  -7, --compression-level-7          Synonymous with -l 8 -b 4096 -m -e -r 6
  -8, --compression-level-8, --best  Synonymous with -l 12 -b 4096 -m -e -r 6