add 2206 to copyright notice
[platform/upstream/flac.git] / doc / html / faq.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <!-- Copyright (c)  2000,2001,2002,2003,2004,2005,2006 Josh Coalson -->
3 <!-- Permission is granted to copy, distribute and/or modify this document -->
4 <!-- under the terms of the GNU Free Documentation License, Version 1.1 -->
5 <!-- or any later version published by the Free Software Foundation; -->
6 <!-- with no invariant sections. -->
7 <!-- A copy of the license can be found at http://www.gnu.org/copyleft/fdl.html -->
8 <html>
9 <head>
10         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
11         <meta name="author" content="Josh Coalson" />
12         <meta name="description" content="A free, open source codec for lossless audio compression and decompression" />
13         <meta name="keywords" content="free,lossless,audio,codec,encoder,decoder,compression,compressor,archival,archive,archiving,backup,music" />
14         <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
15         <link rel="stylesheet" type="text/css" href="flac.css" />
16         <title>FLAC - faq</title>
17 </head>
18
19 <body>
20
21 <div class="logo">
22         <a href="http://flac.sourceforge.net/"><img src="images/logo130.gif" alt="FLAC Logo" align="middle" border="0" hspace="0" /></a>
23 </div>
24
25 <div class="above_nav"></div>
26
27 <div class="navbar">
28         &nbsp;<a href="index.html">home</a>&nbsp;&nbsp;|
29         &nbsp;faq&nbsp;&nbsp;|
30         &nbsp;<a href="news.html">news</a>&nbsp;&nbsp;|
31         &nbsp;<a href="download.html">download</a>&nbsp;&nbsp;|
32         &nbsp;<a href="features.html">features</a>&nbsp;&nbsp;|
33         &nbsp;<a href="goals.html">goals</a>&nbsp;&nbsp;|
34         &nbsp;<a href="format.html">format</a>&nbsp;&nbsp;|
35         &nbsp;<a href="id.html">id</a>&nbsp;&nbsp;|
36         &nbsp;<a href="comparison.html">comparison</a>&nbsp;&nbsp;|
37         &nbsp;<a href="documentation.html">documentation</a>&nbsp;&nbsp;|
38         &nbsp;<a href="changelog.html">changelog</a>&nbsp;&nbsp;|
39         &nbsp;<a href="links.html">links</a>&nbsp;&nbsp;|
40         &nbsp;<a href="developers.html">developers</a>&nbsp;
41 </div>
42
43 <div class="langbar">
44         &nbsp;english&nbsp;&nbsp;|
45         &nbsp;<a href="ru/faq.html">russian</a>&nbsp;
46 </div>
47
48 <div class="below_nav"></div>
49
50 <div class="box">
51         <div class="box_title">
52                 faq
53         </div>
54         <div class="box_header"></div>
55         <div class="box_body">
56                 <b>General</b>
57                 <ul>
58                         <li>
59                                 <a href="#general__license"><b>What licensing applies to the FLAC format and software?</b></a>
60                         </li>
61                         <li>
62                                 <a href="#general__tagging"><b>What kinds of tags does FLAC support?</b></a>
63                         </li>
64                         <li>
65                                 <a href="#general__software"><b>What software support FLAC?</b></a>
66                         </li>
67                         <li>
68                                 <a href="#general__hardware"><b>What hardware products support FLAC?</b></a>
69                         </li>
70                         <li>
71                                 <a href="#general__native_vs_ogg"><b>What is the difference between (native) FLAC and Ogg FLAC?</b></a>
72                         </li>
73                         <li>
74                                 <a href="#general__native_or_ogg"><b>Which should I use, (native) FLAC or Ogg FLAC?</b></a>
75                         </li>
76                         <li>
77                                 <a href="#general__no_cuesheet_tags"><b>Why aren't PERFORMER/TITLE/etc tags stored in the FLAC CUESHEET block?</b></a>
78                         </li>
79                         <li>
80                                 <a href="#general__no_wave_metadata"><b>Why doesn't FLAC store all WAVE metadata?</b></a>
81                         </li>
82                         <li>
83                                 <a href="#general__asymmetry"><b>Why do the encoder settings have a big effect on the encoding time but not the decoding time?</b></a>
84                         </li>
85                         <li>
86                                 <a href="#general__alternatives"><b>Why use FLAC instead of other codecs that compress more?</b></a>
87                         </li>
88                         <li>
89                                 <a href="#general__encode_faster"><b>Why can't you make FLAC encode faster?</b></a>
90                         </li>
91                         <li>
92                                 <a href="#general__lossless_trust"><b>How can I be sure FLAC is lossless?</b></a>
93                         </li>
94                         <li>
95                                 <a href="#general__testing"><b>How much testing has been done on FLAC?</b></a>
96                         </li>
97                         <li>
98                                 <a href="#general__lowest_bitrate"><b>What is the lowest bitrate (or highest compression) achievable with FLAC?</b></a>
99                         </li>
100                         <li>
101                                 <a href="#general__channels"><b>How many channels does FLAC support?</b></a>
102                         </li>
103                         <li>
104                                 <a href="#general__samples"><b>What kind of audio samples does FLAC support?</b></a>
105                         </li>
106                 </ul>
107                 <b>Tools</b>
108                 <ul>
109                         <li>
110                                 <a href="#tools__eac_and_flac"><b>How do I set up EAC to rip directly to FLAC?</b></a>
111                         </li>
112                         <li>
113                                 <a href="#tools__option_blocking"><b>How do I encode a file that starts with a dash?</b></a>
114                         </li>
115                         <li>
116                                 <a href="#tools__long_meta_edits"><b>Why does it take so long to edit some FLAC files with metaflac?</b></a>
117                         </li>
118                         <li>
119                                 <a href="#tools__hardware_prob"><b>I compressed a file to FLAC with verify on, and flac said "Verify FAILED!"  Why?</b></a>
120                         </li>
121                         <li>
122                                 <a href="#tools__wave_flac_wave"><b>I compressed a WAVE file to FLAC, then decompressed to WAVE, and the two weren't identical.  Why?</b></a>
123                         </li>
124                         <li>
125                                 <a href="#tools__skipped_subchunk"><b>I compressed a WAVE file to FLAC and it said "warning: skipping unknown sub-chunk LIST".  Why?</b></a>
126                         </li>
127                         <li>
128                                 <a href="#tools__two_bytes_short"><b>I decoded a FLAC file and the WAVE is 2 bytes shorter than the original.  Why?</b></a>
129                         </li>
130                         <li>
131                                 <a href="#tools__not_streamable"><b>Why did I get "ERROR initializing encoder, state = 14:FLAC__STREAM_ENCODER_NOT_STREAMABLE"?</b></a>
132                         </li>
133                 </ul>
134                 <b>API</b>
135                 <ul>
136                         <li>
137                                 <a href="#api__frame_length"><b>How can I determine the encoded frame length?</b></a>
138                         </li>
139                 </ul>
140                 <b>Project</b>
141                 <ul>
142                         <li>
143                                 <a href="#project__lists"><b>Where are the mailing lists, forums, discussion areas, etc.?</b></a>
144                         </li>
145                         <li>
146                                 <a href="#project__submit_bug"><b>How do I submit a bug report?</b></a>
147                         </li>
148                 </ul>
149
150                 <h2>
151                         <b>General</b>
152                 </h2>
153
154                 <a name="general__license"><b>What licensing applies to the FLAC format and software?</b></a><br />
155                 <br />
156                 See the <a href="license.html">license page</a>.<br />
157                 <br />
158                 <a name="general__tagging"><b>What kinds of tags does FLAC support?</b></a><br />
159                 <br />
160                 FLAC has it's own native tagging system which is identical to that of Vorbis.  They are called alternately "FLAC tags" and "Vorbis comments".  It is the only tagging system required and guaranteed to be supported by FLAC implementations.<br />
161                 <br />
162                 Out of convenience, the reference decoder knows how to skip ID3 tags so that they don't interfere with decoding.  But you should not expect any tags beside FLAC tags to be supported in applications; some implementations may not even be able to decode a FLAC file with ID3 tags.<br />
163                 <br />
164                 <a name="general__software"><b>What software support FLAC?</b></a><br />
165                 <br />
166                 This list is so large now it is difficult to maintain and keep up-to-date.  For a partial list of open-source software that supports FLAC, see the <a href="links.html#software">software section</a> of the links page.  For a partial list of the most popular software used to encode, decode, play, tag, and rip FLAC files, see the <a href="download.html">download page</a>.<br />
167                 <br />
168                 <a name="general__hardware"><b>What hardware products support FLAC?</b></a><br />
169                 <br />
170                 See the <a href="links.html#hardware">hardware section</a> of the links page.<br />
171                 <br />
172                 <a name="general__native_vs_ogg"><b>What is the difference between (native) FLAC and Ogg FLAC?</b></a><br />
173                 <br />
174                 You can think of an audio codec as having two layers.  The inside layer is the raw compressed data, and the outside layer is the "container" or "transport layer" that splits and arranges the compressed data in pieces so it can be seeked through, edited, etc.<br />
175                 <br />
176                 "Native" FLAC is the compressed FLAC data stored in a very minimalist container, designed to be very efficient at storing single audio streams.<br />
177                 <br />
178                 Ogg FLAC is the compressed FLAC data stored in an <a href="http://xiph.org/ogg/vorbis/doc/oggstream.html">Ogg container</a>.  Ogg is a much more powerful transport layer that enables mixing several kinds of different streams (audio, data, metadata, etc).  The overhead is slightly higher than with native FLAC.<br />
179                 <br />
180                 In either case, the compressed FLAC data is the same and one can be converted to the other without re-encoding.<br />
181                 <br />
182                 <a name="general__native_or_ogg"><b>Which should I use, (native) FLAC or Ogg FLAC?</b></a><br />
183                 <br />
184                 The short answer right now is probably "native FLAC".  If all you are doing is compressing audio to be played back later, native FLAC will do everything you need, is more widely supported, and will yield smaller files.  If you plan to edit the compressed audio, or want to multiplex the audio with video later in an Ogg container, Ogg FLAC is a better choice.<br />
185                 <br />
186                 <a name="general__no_cuesheet_tags"><b>Why aren't PERFORMER/TITLE/etc tags stored in the FLAC CUESHEET block?</b></a><br />
187                 <br />
188                 This has turned out to be a pretty polarizing issue and requires a long explanation.<br />
189                 <br />
190                 The original purpose of a cue sheet in CD authoring software was to lay out the disc, essentially specifying how the audio will be organized on the disc; some of the information ends up as the CD table of contents: the track numbers and locations, and the index points.  Later CD-TEXT was added.  But CD-TEXT is a very complex spec, and actually goes in the CD subcode data.  It is internationalized, not through Unicode, but with several different character sets, some of them multi-byte.  It even allows for graphics.  In cue sheets, the TITLE/PERFORMER/etc tags are just a limited shorthand for authoring CD-TEXT, but when you rip, you almost never parse the CD-TEXT, you get it from another database, and it doesn't really belong in the FLAC CUESHEET block.<br />
191                 <br />
192                 For FLAC the intention is that applications can calculate the CDDB or CDindex ID from the CUESHEET block and look it up in an online or local database just like CD rippers and players do.  But if you really want it in the file itself, the track metadata should be stored separate from the CUESHEET, and already can be because of FLAC's metadata system.  There just isn't a method specified yet because as soon as it is, people will say that it's not flexible enough.  From experience (and you can see this come up time and time again in many lists), anyone who is going to the trouble of keeping a lossless collection in the first place will already be picky about metadata, and it is hard to come up with a standard that will please even the majority.  That is the big problem with metadata and is why Xiph has deferred on it, waiting for someone to come up with a good metadata spec that can me multiplexed together with data.<br />
193                 <br />
194                 Some players (for example Foobar2000) allow you to store the CDDB data as FLAC tags and can parse that.<br />
195                 <br />
196                 <a name="general__no_wave_metadata"><b>Why doesn't FLAC store all WAVE metadata?</b></a><br />
197                 <br />
198                 FLAC is a general-purpose audio format, not just a compressed WAVE file format.  There's a subtle difference.  WAVE is a complicated standard; many kinds of data besides audio data can be put in it.  FLAC's purpose is not to reproduce a WAVE file, including all the non-audio data that is in it, it is to losslessly compress the audio.<br />
199                 <br />
200                 People have asked for that in FLAC, but if it were added, then what about similar formats like AIFF?  <span class="commandname">flac</span> can extract and compress audio data in an AIFF file also.  AIFF is widely used on the Mac.  AIFF users have asked that all AIFF metadata be stored for the same reasons.  And it doesn't end there, other uncompressed formats exist.<br />
201                 <br />
202                 Also, it would add a lot of complexity to FLAC because non-audio data has to go in the metadata section which is at the beginning of the FLAC file.  But in WAVE and AIFF it can go before or after the audio, so the encoding would have to make multiple passes and also store the chunk hierarchy to be able to reproduce it.<br />
203                 <br />
204                 <a name="general__asymmetry"><b>Why do the encoder settings have a big effect on the encoding time but not the decoding time?</b></a><br />
205                 <br />
206                 It's hard to explain without going into the codec design, but to oversimplify, the encoder is looking for functions that approximate the signal.  Higher settings make the encoder search more to find better approximations.  The functions are themselves encoded in the FLAC file.  Decoding only requires computing the one chosen function, and the complexity of the function is very stable.  This is by design, to make decoding easier, and is one of the things that makes FLAC easy to implement in hardware.<br />
207                 <br />
208                 <a name="general__alternatives"><b>Why use FLAC instead of other codecs that compress more?</b></a><br />
209                 <br />
210                 For most users, a small difference in filesize is usually far outweighed by FLAC's advantages: open patent free codec, portable open source (BSD) reference implementation, documented API, multi-platform support, hardware support, multi-channel support, etc.  Improving FLAC to get a little more compression is not worth making it more complex and more compute-intensive to decode, and hence, less likely to be supported in hardware.<br />
211                 <br />
212                 <a name="general__encode_faster"><b>Why can't you make FLAC encode faster?</b></a><br />
213                 <br />
214                 FLAC already encodes pretty fast.  It is faster than real-time even on weak systems and is not much slower than even the fastest codecs.  And it is faster than the CD ripping process with which it is usually paired, meaning even if it went faster, it would not speed up the ripping-encoding process anyway.<br />
215                 <br />
216                 Part of the reason is that FLAC is asymmetric <a href="#general__asymmetry">(see also)</a>.  That means that it is optimized for decoding speed at the expense of encoding speed, because it makes it easier to decode on low-powered hardware, and because you only encode once but you decode many times.  <br />
217                 <br />
218                 <a name="general__lossless_trust"><b>How can I be sure FLAC is lossless?</b></a><br />
219                 <a name="general__testing"><b>How much testing has been done on FLAC?</b></a><br />
220                 <br />
221                 First, FLAC is probably the only lossless compressor that has a published and comprehensive test suite.  With the others you rely on the author's personal testing or the longevity of the program.  But with FLAC you can download the whole test suite and run it on any version you like, or alter it to test your own data.  The test suite checks every function in the API, as well as running many thousands of streams through an encode-decode-verify process, to test every nook and cranny of the system.  Even on a fast machine the full test suite takes hours.  The full test suite must pass on several platforms before a release is made.<br />
222                 <br />
223                 Second, you can always use the <span class="argument">-V</span> option with <span class="commandname">flac</span> (also supported by most GUI frontends) to verify while encoding.  With this option, a decoder is run in parallel to the encoder and its output is compared against the original input.  If a difference is found <span class="commandname">flac</span> will stop with an error.<br />
224                 <br />
225                 Finally, FLAC is used by many people and has been judged stable enough by many software and hardware makers to be incorporated into their products.<br />
226                 <br />
227                 <a name="general__lowest_bitrate"><b>What is the lowest bitrate (or highest compression) achievable with FLAC?</b></a><br />
228                 <br />
229                 With FLAC you do not specify a bitrate like with some lossy codecs.  It's more like specifying a quality with Vorbis or MPC, except with FLAC the quality is always "lossless" and the resulting bitrate is roughly proportional to the amount of information in the original signal.  You cannot control the bitrate much and the result can be from around 100% of the input rate (if you are encoding noise), down to almost 0 (encoding silence).<br />
230                 <br />
231                 <a name="general__channels"><b>How many channels does FLAC support?</b></a><br />
232                 <br />
233                 FLAC supports from 1 to 8 channels per stream.  Channels are only grouped in FLAC to take advantage of interchannel correlation and to define common channel assignments (like stereo L/R, 5.1 surround, et cetera).  When encoding a large number of independent channels it is expected that they are coded separately and if required, multiplexed together in a suitable container like Ogg or Matroska.<br />
234                 <br />
235                 <a name="general__samples"><b>What kind of audio samples does FLAC support?</b></a><br />
236                 <br />
237                 FLAC supports linear PCM samples with a resolution between 4 and 32 bits per sample.  FLAC does not support floating point samples.  In some cases it is possible to losslessly transform samples from an incompatible range to a FLAC-compatible range before encoding.<br />
238                 <br />
239                 FLAC supports linear sample rates from 1Hz - 655350Hz in 1Hz increments.
240
241                 <h2>
242                         <b>Tools</b>
243                 </h2>
244
245                 <a name="tools__eac_and_flac"><b>How do I set up EAC to rip directly to FLAC?</b></a><br />
246                 <br />
247                 See Case's excellent <a href="http://www.saunalahti.fi/cse/EAC/index.html">EAC configuration page</a>.  Or use <a href="http://mareo.netfirms.com/">MAREO</a> to rip to multiple formats at once.<br />
248                 <br />
249                 <a name="tools__option_blocking"><b>How do I encode a file that starts with a dash?</b></a><br />
250                 <br />
251                 When using <span class="commandname">flac</span> to encode on the command-line, a file that starts with a dash will be treated as an option, but there is a simple workaround.  Use <span class="argument">--</span> to signal the end of options and the beginning of filenames, like so:<br />
252                 <br />
253                 <span class="code">flac -V -- -01-name.wav</span><br />
254                 <br />
255                 <a name="tools__long_meta_edits"><b>Why does it take so long to edit some FLAC files with metaflac?</b></a><br />
256                 <br />
257                 Since metadata is stored at the beginning of a FLAC file, changing the length of it can sometimes cause the whole file to be rewritten.  You can avoid this by adding padding with <span class="commandname">flac</span> when you encode, or with <span class="commandname">metaflac</span> after encoding.  By default, <span class="commandname">flac</span> adds 4k of padding; you can change this amount if you need more or less.<br />
258                 <br />
259                 <a name="tools__hardware_prob"><b>I compressed a file to FLAC with verify on, and flac said "Verify FAILED!"  Why?</b></a><br />
260                 <br />
261                 Every single report of this has turned out to be caused by a hardware problem, usually aggressive over-clocking or bad RAM.  The best indicator of this is that the verify failure does not always happen in the same place for the same file.  First, read the comments in <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=595858&amp;group_id=13478&amp;atid=113478">this bug report</a>.  Then, if you have a file that fails verification in the same place every time, <a href="#project__submit_bug">submit a new bug</a>, uploading a sample according to <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=585158&amp;group_id=13478&amp;atid=113478">the instructions found at the bottom of this bug report</a>.<br />
262                 <br />
263                 <a name="tools__wave_flac_wave"><b>I compressed a WAVE file to FLAC, then decompressed to WAVE, and the two weren't identical.  Why?</b></a><br />
264                 <a name="tools__skipped_subchunk"><b>I compressed a WAVE file to FLAC and it said "warning: skipping unknown sub-chunk LIST".  Why?</b></a><br />
265                 <br />
266                 WAVE is a complicated standard; many kinds of data besides audio data can be put in it.  Most likely what has happened is that the application that created the original WAVE file also added some extra information for it's own use, which FLAC does not store or recreate  <a href="#tools__two_bytes_short">(see also)</a>.  But the audio data in the two WAVE files will be identical.  There are other tools to compare just the audio content of two WAVE files; <a href="http://www.exactaudiocopy.de/">ExactAudioCopy</a> has such a feature.<br />
267                 <br />
268                 For the more technically inclined, FLAC only stores what is in the 'fmt ' and 'data' sub-chunks of a WAVE file.<br />
269                 <br />
270                 <a href="#general__no_wave_metadata">(see also)</a><br />
271                 <br />
272                 <a name="tools__two_bytes_short"><b>I decoded a FLAC file and the WAVE is 2 bytes shorter than the original.  Why?</b></a><br />
273                 <br />
274                 The difference is probably that between an 18-byte 'fmt ' subchunk in the original WAVE vs. a 16-byte one in the decoded WAVE.  With WAVE there is more than one way to write identical formatting information, but FLAC always writes the most common form.  <a href="#tools__wave_flac_wave">(see also)</a><br />
275                 <br />
276                 <a name="tools__not_streamable"><b>Why did I get "ERROR initializing encoder, state = 14:FLAC__STREAM_ENCODER_NOT_STREAMABLE"?</b></a><br />
277                 <br />
278                 You specified encoding options that are outside the <a href="format.html#subset">Streamable subset</a>.  If that is what you really wanted, you must also use <span class="code">flac --lax</span>.
279
280                 <h2>
281                         <b>API</b>
282                 </h2>
283
284                 <a name="api__frame_length"><b>How can I determine the encoded frame length?</b></a><br />
285                 <br />
286                 With native FLAC, it is not possible to determine the frame length without decoding.  Probably if I had it all to do again I would have constrained the possible block sizes, which would have made it more practical to put the frame length in the frame header.  For an example of how to find the frame boundaries in a stream, see the source code to <span class="commandname">metaflac</span>, in the functionality that adds seek points.<br />
287                 <br />
288                 With Ogg FLAC, it can be calculated from the Ogg page header.
289
290                 <h2>
291                         <b>Project</b>
292                 </h2>
293
294                 <a name="project__lists"><b>Where are the mailing lists, forums, discussion areas, etc.?</b></a><br />
295                 <br />
296                 There are a few places.  The main discussions happen on <a href="http://sourceforge.net/mail/?group_id=13478">the official FLAC mailing lists</a>.  Eventually we will be transitioning over to <a href="http://xiph.org/archives/">the lists on Xiph.org</a>.  Also, there is a lot of discussion relating to FLAC on <a href="http://www.hydrogenaudio.org/">Hydrogen Audio</a>.<br />
297                 <br />
298                 <a name="project__submit_bug"><b>How do I submit a bug report?</b></a><br />
299                 <br />
300                 First, <a href="http://sourceforge.net/tracker/?group_id=13478&amp;atid=113478">visit the bug tracking page</a> and do a little searching of both open and closed bugs to see if yours is already there.  If you have something truly new, <a href="http://sourceforge.net/bugs/?func=addbug&amp;group_id=13478">submit a new bug</a>.  <b>Make sure</b> to monitor the bug or include your email address in the description.  Include as much information as possible: the version of FLAC that you are running, the name and version of any frontend you are running, your operating system and version, your CPU type and speed, the amount of memory you have, where you downloaded FLAC from, the exact error message (if any) copied from the console, and anything else you may think will help.
301         </div>
302         <div class="box_footer"></div>
303 </div>
304
305
306 <div class="copyright">
307         Copyright (c) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson
308 </div>
309
310 </body>
311 </html>