Skip to main content

Topic: New FLAC encoder (Read 291005 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • JWolf
  • [*][*]
New FLAC encoder
Reply #300
I have a Rio Karma and while it can play FlAKE -12 compressed flac files, it has a lot of trouble seeking with these FLAC files. FLAC 1.1.2_CVS which gets close compression works great with my Rio Karma.

What I'd like to know is what are the best settings for Flake to work with my Rio Karma? I'd like to compare compressions sizes to find out which is better. I was playing around and ended up gettng a larger file that didn't work vs FLAC 1.1.2_CVS.

What setting is it in FLAKE that causes it not to be fully compatible with my Rio? I tried the -v 1 as suggested earlier in the thread to make it compatible with FLAC and that also failed.

Jon

For now the best setting for your Rio would probably be "flake -10".  It generates files which are roughly equivalent (compatibility-wise) to "flac -8".  Definitely don't use -v 1 since it is probably the most experimental option and has compatibility issues.

edit: to answer your other question more fully, it's probably the max LPC order which is causing problems on the Rio with flake -12 files.

edit2: Given the many questions, for the next release, I will try to make some documentation devoted to compatibility of various features of the FLAC specification and Flake encoding parameters.

-Justin


I just tested Flake at -10 and found that the compatability with seeking in my Rio Karma still isn't there. I did the same track in Flac 1.1.2_CVS and compatability is perfect. My settings for Flac are "-8 -A tukey(0.25) -A gauss(0.1875) -V --sector-align %1" and the file sizes are very similar between the two. 34,189,547 for Flake and 34,153,250 for Flac. There is something different in the Flake file that the Rio Karma is not liking. I just decided to try Flake at -1 and it still doesn't seek properly. Once it plays it will play allt he way fine. But as for seeking it eaier doesn't seek or takes a long time to seek.

  • Madman2003
  • [*][*][*]
New FLAC encoder
Reply #301
You do realize flake does not add seek points to the file (at least version 0.10 doesn't)? Try adding seekpoints using metaflac.

  • JWolf
  • [*][*]
New FLAC encoder
Reply #302
You do realize flake does not add seek points to the file (at least version 0.10 doesn't)? Try adding seekpoints using metaflac.

I'll have to try that. I didn't realize. Thanks!

  • JWolf
  • [*][*]
New FLAC encoder
Reply #303
Hot damn! Adding seek points works. Thank you Madman2003.

New FLAC encoder
Reply #304
My wife is possibly beginning labour at the moment, so I kind of have other things on my mind. 

Great avatar  and congratulations.
  • Last Edit: 22 October, 2006, 02:12:53 PM by Justin Ruggles

New FLAC encoder
Reply #305
'grats everyone, you made it into Winamp 5.31
http://forums.winamp.com/showthread.php?s=...threadid=258205

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
New FLAC encoder
Reply #306
Congratulations Justin.  Given both Winamp and FLAC's popularity this seems like an excellent achievement to me.

Great avatar  and congratulations.
Thank you.
I'm on a horse.

  • jcoalson
  • [*][*][*][*][*]
  • Developer
New FLAC encoder
Reply #307
'grats everyone, you made it into Winamp 5.31
http://forums.winamp.com/showthread.php?s=...threadid=258205

just confirmed, it's using r108.  flake is neat and has promise but I think this is premature to use it in winamp now for the following reasons:

1. no seektable support which can make seeking awkwards.

2. still too easy to create non-subset streams.  the winamp plugin goes up to -12 and there is no warning for -11 or -12.

except in rare cases, non-subset streams are an extremely poor tradeoff of reduced usability for a tiny fraction of compression.  that's why even in libFLAC you have to explicitly turn off subset support when using non-subset options or the encoder init call will fail.

3. most important, flake is not well tested.  I built r108 and ran part of the FLAC test suite against it (stereo 16bps streams), and some files silently failed to generate correct FLAC files, i.e. encoding them appeared to work but the decoded file did not match the input.

users will be more forgiving for a decoder; another decoder can be used to recover a good FLAC file. but a lossless encoder is going to be held to a higher standard.  if it generates FLACs that are not lossless or cause problems on playback, that's more serious.

Josh


edit: I hope "flake is not well tested" doesn't sound critical, what I mean is not tested well-enough as a lossless encoder for production use.

  • MedO
  • [*][*][*][*]
New FLAC encoder
Reply #308
3. most important, flake is not well tested.  I built r108 and ran part of the FLAC test suite against it (stereo 16bps streams), and some files silently failed to generate correct FLAC files, i.e. encoding them appeared to work but the decoded file did not match the input.


Argh, stupid me. I already used flake in my daily "work", but for security wrote a small wrapper script that would use flac -d and an md5summer to ensure the created flac file was ok. I thought this way I could safely use flake and also give some feedback when I encountered a problem. However, I just found out the script has a bug and let any errors through without warning  . Maybe I should have tested it *before* using... ah well.

In what way were the files damaged, i.e. would flactester catch faulty ones?

  • jcoalson
  • [*][*][*][*][*]
  • Developer
New FLAC encoder
Reply #309
In what way were the files damaged, i.e. would flactester catch faulty ones?

I will check it out more tonight and upload a sample, but the FLACs were valid, they just decoded to different audio than the input.  also the MD5 sum was wrong.

Josh

  • Egor
  • [*][*][*][*][*]
New FLAC encoder
Reply #310
also the MD5 sum was wrong.

Does it mean that flake stored wrong MD5 of the original audio? I mean, is it secure to test flake implementation with just "flac -t", or is it necessary to decode and compare with the original?


BTW, shouldn't it be "we recommend not to use it for archival" instead of "we recommend to not use it for archival"? 

  • jcoalson
  • [*][*][*][*][*]
  • Developer
New FLAC encoder
Reply #311
Does it mean that flake stored wrong MD5 of the original audio? I mean, is it secure to test flake implementation with just "flac -t", or is it necessary to decode and compare with the original?

flac -t does not catch it as the flake file has a correct MD5 sum for its audio, but the audio is not the same as the original wave.

Josh

  • MedO
  • [*][*][*][*]
New FLAC encoder
Reply #312
Does it mean that flake stored wrong MD5 of the original audio? I mean, is it secure to test flake implementation with just "flac -t", or is it necessary to decode and compare with the original?

flac -t does not catch it as the flake file has a correct MD5 sum for its audio, but the audio is not the same as the original wave.

Josh


Is the difference large or is it just, like, the least significant bit in a few samples changed?

  • Egor
  • [*][*][*][*][*]
New FLAC encoder
Reply #313
Is the difference large or is it just, like, the least significant bit in a few samples changed?

He-he    that doesn't matter. The question is whether flake is lossless (no data lost or changed) or not.

  • MedO
  • [*][*][*][*]
New FLAC encoder
Reply #314
Is the difference large or is it just, like, the least significant bit in a few samples changed?

He-he    that doesn't matter. The question is whether flake is lossless (no data lost or changed) or not.


I know that this is a serious bug, but I'm trying to decide whether to re-rip the CDs I already compressed with flake.

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
New FLAC encoder
Reply #315
Question regarding setting up foobar with Flake moved to this thread. Issue is foobar-/user-related, not a Flake issue.
I'm on a horse.

  • jcoalson
  • [*][*][*][*][*]
  • Developer
New FLAC encoder
Reply #316
ok, turns out the trouble with this particular file is actually in the wave chunk handling; I think it is including non-'data' chunks that follow the 'data' chunk and treating them as audio.  when I have more time after the next release I will look into the rest of the suite.

Josh
[ Specified attachment is not available ]

  • Madman2003
  • [*][*][*]
New FLAC encoder
Reply #317
ok, turns out the trouble with this particular file is actually in the wave chunk handling; I think it is including non-'data' chunks that follow the 'data' chunk and treating them as audio.  when I have more time after the next release I will look into the rest of the suite.

Josh
(Attachment Link)


I'll asume that the problem exists, i'm curious how you made that file (in other words, should i worry about some flac's i created).

  • wisodev
  • [*][*][*]
  • Developer
New FLAC encoder
Reply #318
Flake (Win32) from SVN revision 112 available:

Note:
I've changed way I build binarys. The old method used visual studio project files. Now I'm using simple batch script (build_intel.cmd available in src archive) to directly compile and link binarys using only Intel C++ Compiler. As results you don't need Visual Studio to build flake under windows. You need only Intel C++ Compiler and MS Platform SDK. The old project files are still available. And one more thing it seems that new binarys are just bit faster ;-)

Download from my Website

or use direct links:

Download binarys:
flake-svn-r112-win32-bin.zip

Download sources:
flake-svn-r112-win32-src.zip

wisodev

EDIT: changed url to downloads and my website
  • Last Edit: 29 November, 2006, 11:36:36 AM by wisodev

  • JWolf
  • [*][*]
New FLAC encoder
Reply #319
ok, turns out the trouble with this particular file is actually in the wave chunk handling; I think it is including non-'data' chunks that follow the 'data' chunk and treating them as audio.  when I have more time after the next release I will look into the rest of the suite.

Josh
(Attachment Link)

Turns out FLAC 1.1.3 beta 2 also cannot handle this WAV file without an error.

flac 1.1.3beta2, Copyright © 2000,2001,2002,2003,2004,2005,2006  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

options: -P 8192 -b 4608 -m -l 12 -e -q 0 -r 0,6
wacky2.wav: WARNING: skipping unknown sub-chunk 'fact'
wacky2.wav: WARNING: skipping unknown sub-chunk 'pad '
wacky2.wav: WARNING: skipping unknown sub-chunk 'pad '
wacky2.wav: wrote 8328 bytes, ratio=138.800

The resulting WAV from the FLAC file no longer matches. The original is 96 bytes and the decompressed one is 60 bytes. FLAKE 's decompressed WAV file is 72 bytes.
  • Last Edit: 06 November, 2006, 06:26:14 PM by JWolf

  • jcoalson
  • [*][*][*][*][*]
  • Developer
New FLAC encoder
Reply #320
no, that's not an error, it's a warning that it is skipping unsupported subchunks.  the audio is correctly compressed with flac-1.1.3 (and earlier).

with flake, the non-audio subchunk that follows the audio is treated as audio and compressed along with the audio.  that's why when decoded it decodes to more audio samples than are in the original wave file.

Josh

New FLAC encoder
Reply #321
no, that's not an error, it's a warning that it is skipping unsupported subchunks.  the audio is correctly compressed with flac-1.1.3 (and earlier).

with flake, the non-audio subchunk that follows the audio is treated as audio and compressed along with the audio.  that's why when decoded it decodes to more audio samples than are in the original wave file.

Josh
This would be a bug in the flake wav reading code. Winamp doesn't use this code, our WAV reading is done by libsndfile (which as far as I know, doesn't have this problem).

  • mpxplay
  • [*]
New FLAC encoder
Reply #322
I've made a FLAKE output plugin for Mpxplay and I've added ID3-info (artist,title,etc.) handling for the vorbis-comment function(s). Something similar would be nice in the original flake lib too.

You can download the modified source of v0.10 here: http://www.freewebtown.com/mpxplay -> SCFLACS.ZIP

A short list about the modifications (maybe not complete):
- a new struct FlakeComments_t in flake.h, added to the end of struct FlakeContext
- flake_comment_init_utf8(FlakeContext *s,char *codepage) function to enable UTF8 text encoding (you have to call it by standard), the "codepage" is required for DOS version only (set it to NULL)
- flake_comment_add(FlakeContext *s,char *type,char *data), where the "type" can be "artist","title","album","date","genre","comment" or other standard vorbiscomment types
- modified write_vorbis_comment() function in encode.c
- added AnsiToUTF8 function to encode.c, but the the WIN32 version is not tested at all

You have to call flake_comment_init_utf8() and flake_comment_add() functions first,
then the flake_encode_init().

regards
Attila

  • Northpole
  • [*]
New FLAC encoder
Reply #323
I downloaded the SVN zip, unzipped (I just unzipped to my desktop for speed), opened a command line in the "bin" ("\svn-win32-1.4.0\svn-win32-1.4.0\bin") directory and then used the command:

svn co https://svn.sourceforge.net/svnroot/flake-enc flake-enc

This created a folder in my "bin" directory called "flake-enc".  I then moved that to somewhere more convenient (a short path with no spaces) and then ran "./configure" then "make" using a cygwin console.


@Synthetic Soul,

I downloaded and tried to compile flake with mingw like your above instructions, but didn't have any luck.  The download created the flake "bin" directory and I moved it to a easy to get at location as you did.  What command line did you use and did you enter it in the MSYS console?

I have MSYS-1.0.11 installed.  I have tried the "configure&&make" command in the MSYS console window but all I get is "exec: bash: not found

Any pointer would be most welcome.

  • Mangix
  • [*][*][*][*][*]
New FLAC encoder
Reply #324