flac [ OPTIONS ] [ infile.wav | infile.rf64 | infile.aiff | infile.raw | infile.flac | infile.oga | infile.ogg | - ... ]
flac [ -d | --decode | -t | --test | -a | --analyze ] [ OPTIONS ] [ infile.flac | infile.oga | infile.ogg | - ... ]
flac is a command-line tool for encoding, decoding, testing and analyzing FLAC streams.
A summary of options is included below. For a complete description, see the HTML documentation.
When decoding, force the input to be treated as Ogg FLAC. This is useful when piping input from stdin or when the filename does not end in '.oga' or '.ogg'.
WARNING: THIS IS NOT LOSSLESS. DECODED AUDIO WILL NOT BE IDENTICAL TO THE ORIGINAL WITH THIS OPTION.
The equals sign and <specification> is optional. If omitted, the default is 0aLn1.
The <specification> is a shorthand notation for describing how to apply ReplayGain. All components are optional but order is important. '[]' means 'optional'. '|' means 'or'. '{}' means required. The format is:
[<preamp>][a|t][l|L][n{0|1|2|3}]
For example, the default of 0aLn1 means 0dB preamp, use album gain, 6dB hard limit, low noise shaping.
--apply-replaygain-which-is-not-lossless=3 means 3dB preamp, use album gain, no limiting, no noise shaping.
flac uses the ReplayGain tags for the calculation. If a stream does not have the required tags or they can't be parsed, decoding will continue with a warning, and no ReplayGain is applied to that stream.
[TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE
TYPE is optional; it is a number from one of:
0: Other
1: 32x32 pixels 'file icon' (PNG only)
2: Other file icon
3: Cover (front)
4: Cover (back)
5: Leaflet page
6: Media (e.g. label side of CD)
7: Lead artist/lead performer/soloist
8: Artist/performer
9: Conductor
10: Band/Orchestra
11: Composer
12: Lyricist/text writer
13: Recording Location
14: During recording
15: During performance
16: Movie/video screen capture
17: A bright coloured fish
18: Illustration
19: Band/artist logotype
20: Publisher/Studio logotype
The default is 3 (front cover). There may only be one picture each of type 1 and 2 in a file.
MIME-TYPE is optional; if left blank, it will be detected from the file. For best compatibility with players, use pictures with MIME type image/jpeg or image/png. The MIME type can also be --> to mean that FILE is actually a URL to an image, though this use is discouraged.
DESCRIPTION is optional; the default is an empty string.
The next part specifies the resolution and color information. If the MIME-TYPE is image/jpeg, image/png, or image/gif, you can usually leave this empty and they can be detected from the file. Otherwise, you must specify the width in pixels, height in pixels, and color depth in bits-per-pixel. If the image has indexed colors you should also specify the number of colors used. When manually specified, it is not checked against the file for accuracy.
FILE is the path to the picture file to be imported, or the URL if MIME type is -->
For example, "|image/jpeg|||../cover.jpg" will embed the JPEG file at ../cover.jpg, defaulting to type 3 (front cover) and an empty description. The resolution and color info will be retrieved from the file itself.
The specification "4|-->|CD|320x300x24/173|http://blah.blah/backcover.tiff" will embed the given URL, with type 4 (back cover), description "CD", and a manually specified resolution of 320x300, 24 bits-per-pixel, and 173 colors. The file at the URL will not be fetched; the URL itself is stored in the PICTURE metadata block.
WAV and AIFF files both have an unsigned 32 bit numbers in the file header which specifes the length of audio data. Since this number is unsigned 32 bits, that limits the size of a valid file to being just over 4 Gigabytes. Files larger than this are mal-formed, but should be read correctly using this option.
For gauss(STDDEV), STDDEV is the standard deviation (0<STDDEV<=0.5).
For tukey(P), P specifies the fraction of the window that is tapered (0<=P<=1; P=0 corresponds to "rectangle" and P=1 corresponds to "hann").
For partial_tukey(n) and punchout_tukey(n), n apodization functions are added that span different parts of each block. Values of 2 to 6 seem to yield sane results. If necessary, an overlap can be specified, as can be the taper parameter, for example partial_tukey(2/0.2) or partial_tukey(2/0.2/0.5). ov should be smaller than 1 and can be negative.
Please note that P, STDDEV and ov are locale specific, so a comma as decimal separator might be required instead of a dot.
More than one -A option (up to 32) may be used. Any function that is specified erroneously is silently dropped. The encoder chooses suitable defaults in the absence of any -A options; any -A option specified replaces the default(s).
When more than one function is specified, then for every subframe the encoder will try each of them separately and choose the window that results in the smallest compressed subframe. Multiple functions can greatly increase the encoding time.
metaflac(1)
The programs are documented fully by HTML format documentation, available in /usr/share/doc/libflac-doc/html on Debian GNU/Linux systems.
This manual page was initially written by Matt Zimmerman <mdz@debian.org> for the Debian GNU/Linux system (but may be used by others). It has been kept up-to-date by the Xiph.org Foundation.