packages icon



 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





 NAME
      flac - Free Lossless Audio Codec

 SYNOPSIS
      B]flacR] [ I]OPTIONSR] ] [ I]infile.wavR] | I]infile.rf64R] |
      I]infile.aiffR] | I]infile.rawR] | I]infile.flacR] | I]infile.ogaR] |
      I]infile.oggR] | B]-R] I]...R] ]

      B]flacR] [ B]-dR] | B]--decodeR] | B]-tR] | B]--testR] | B]-aR] | B]--
      analyzeR] ] [ I]OPTIONSR] ] [ I]infile.flacR] | I]infile.ogaR] |
      I]infile.oggR] | B]-R] I]...R] ]

 DESCRIPTION
      B]flacR] is a command-line tool for encoding, decoding, testing and
      analyzing FLAC streams.

 GENERAL USAGE
      B]flacR] supports as input RIFF WAVE, Wave64, RF64, AIFF, FLAC or Ogg
      FLAC format, or raw interleaved samples.  The decoder currently can
      output to RIFF WAVE, Wave64, RF64, or AIFF format, or raw interleaved
      samples.  flac only supports linear PCM samples (in other words, no
      A-LAW, uLAW, etc.), and the input must be between 4 and 32 bits per
      sample.

      flac assumes that files ending in [lq].wav[rq] or that have the RIFF
      WAVE header present are WAVE files, files ending in [lq].w64[rq] or
      have the Wave64 header present are Wave64 files, files ending in
      [lq].rf64[rq] or have the RF64 header present are RF64 files, files
      ending in [lq].aif[rq] or [lq].aiff[rq] or have the AIFF header
      present are AIFF files, files ending in [lq].flac[rq] or have the FLAC
      header present are FLAC files and files ending in [lq].oga[rq] or
      [lq].ogg[rq] or have the Ogg FLAC header present are Ogg FLAC files.

      Other than this, flac makes no assumptions about file extensions,
      though the convention is that FLAC files have the extension
      [lq].flac[rq] (or [lq].fla[rq] on ancient [lq]8.3[rq] file systems
      like FAT-16).

      Before going into the full command-line description, a few other
      things help to sort it out:

      1. flac encodes by default, so you must use -d to decode

      2. Encoding options -0 ..  -8 (or --fast and --best) that control the
         compression level actually are just synonyms for different groups
         of specific encoding options (described later).
      3. The order in which options are specified is generally not important
         except when they contradict each other, then the latter takes pre-
         cedence except that compression presets are overridden by any op-



                                    - 1 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





         tion given before or after.  For example, -0M, -M0, -M2 and -2M are
         all the same as -1, and -l 12 -6 the same as -7.

      4. flac behaves similarly to gzip in the way it handles input and out-
         put files

      Skip to the EXAMPLES section below for examples of some typical tasks.

      flac will be invoked one of four ways, depending on whether you are
      encoding, decoding, testing, or analyzing.  Encoding is the default
      invocation, but can be switch to decoding with B]-dR], analysis with
      B]-aR] or testing with B]-tR].  Depending on which way is chosen, en-
      coding, decoding, analysis or testing options can be used, see section
      OPTIONS for details.  General options can be used for all.

      If only one inputfile is specified, it may be [lq]-[rq] for stdin.
      When stdin is used as input, flac will write to stdout.  Otherwise
      flac will perform the desired operation on each input file to similar-
      ly named output files (meaning for encoding, the extension will be re-
      placed with [lq].flac[rq], or appended with [lq].flac[rq] if the input
      file has no extension, and for decoding, the extension will be
      [lq].wav[rq] for WAVE output and [lq].raw[rq] for raw output).  The
      original file is not deleted unless --delete-input-file is specified.

      If you are encoding/decoding from stdin to a file, you should use the
      -o option like so:


           C]
           flac [options] -o outputfile
           flac -d [options] -o outputfile
           R]

      which are better than:


           C]
           flac [options] > outputfile
           flac -d [options] > outputfile
           R]

      since the former allows flac to seek backwards to write the STREAMINFO
      or RIFF WAVE header contents when necessary.

      Also, you can force output data to go to stdout using -c.

      To encode or decode files that start with a dash, use -- to signal the
      end of options, to keep the filenames themselves from being treated as
      options:



                                    - 2 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool






           C]
           flac -V -- -01-filename.wav
           R]

      The encoding options affect the compression ratio and encoding speed.
      The format options are used to tell flac the arrangement of samples if
      the input file (or output file when decoding) is a raw file.  If it is
      a RIFF WAVE, Wave64, RF64, or AIFF file the format options are not
      needed since they are read from the file[cq]s header.

      In test mode, flac acts just like in decode mode, except no output
      file is written.  Both decode and test modes detect errors in the
      stream, but they also detect when the MD5 signature of the decoded au-
      dio does not match the stored MD5 signature, even when the bitstream
      is valid.

      flac can also re-encode FLAC files.  In other words, you can specify a
      FLAC or Ogg FLAC file as an input to the encoder and it will decoder
      it and re-encode it according to the options you specify.  It will
      also preserve all the metadata unless you override it with other op-
      tions (e.g.  specifying new tags, seekpoints, cuesheet, padding,
      etc.).

      flac has been tuned so that the default settings yield a good speed
      vs.  compression tradeoff for many kinds of input.  However, if you
      are looking to maximize the compression rate or speed, or want to use
      the full power of FLAC[cq]s metadata system, see the page titled
      `About the FLAC Format' on the FLAC website.

 EXAMPLES
      Some typical encoding and decoding tasks using flac:

    Encoding examples
      V]flac abc.wavR]
           Encode abc.wav to abc.flac using the default compression setting.
           abc.wav is not deleted.

      V]flac --delete-input-file abc.wavR]
           Like above, except abc.wav is deleted if there were no errors.

      V]flac --delete-input-file -w abc.wavR]
           Like above, except abc.wav is deleted if there were no errors and
           no warnings.

      V]flac --best abc.wavR] or V]flac -8 abc.wavR]
           Encode abc.wav to abc.flac using the highest compression preset.

      V]flac --verify abc.wavR] or V]flac -V abc.wavR]



                                    - 3 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





           Encode abc.wav to abc.flac and internally decode abc.flac to make
           sure it matches abc.wav.

      V]flac -o my.flac abc.wavR]
           Encode abc.wav to my.flac.

      V]flac abc.aiff foo.rf64 bar.w64R]
           Encode abc.aiff to abc.flac, foo.rf64 to foo.flac and bar.w64 to
           bar.flac

      V]flac *.wav *.aif?R]
           Wildcards are supported.  This command will encode all .wav files
           and all .aif/.aiff/.aifc files (as well as other supported files
           ending in .aif+one character) in the current directory.

      V]flac abc.flac --forceR] or V]flac abc.flac -fR]
           Recompresses, keeping metadata like tags.  The syntax is a little
           tricky: this is an I]encodingR] command (which is the default:
           you need to specify -d for decoded output), and will thus want to
           output the file abc.flac - which already exists.  flac will re-
           quire the --force or shortform -f option to overwrite an existing
           file.  Recompression will first write a temporary file, which
           afterwards replaces the old abc.flac (provided flac has write ac-
           cess to that file).  The above example uses default settings.
           More often, recompression is combined with a different - usually
           higher - compression option.  Note: If the FLAC file does not end
           with .flac - say, it is abc.fla - the -f is not needed: A new
           abc.flac will be created and the old kept, just like for an un-
           compressed input file.

 *.wavR]
      V]flac --tag-from-file=[dq]ALBUM=albumtitle.txt[dq] -
           T [dq]ARTIST=Queen[dq]
           Encode every .wav file in the directory and add some tags.  Every
           file will get the same set of tags.  Warning: Will wipe all ex-
           isting tags, when the input file is (Ogg) FLAC - not just those
           tags listed in the option.  Use the metaflac utility to tag FLAC
           files.

      V]flac --keep-foreign-metadata-if-present abc.wavR]
           FLAC files can store non-audio chunks of input WAVE/AIFF/RF64/W64
           files.  The related option --keep-foreign-metadata works the same
           way, but will instead exit with an error if the input has no such
           non-audio chunks.  The encoder only stores the chunks as they
           are, it cannot import the content into its own tags (vorbis com-
           ments).  To transfer such tags from a source file, use tagging
           software which supports them.

      V]flac -Vj2 -m3fo Track07.flac  -- -7.wavR]



                                    - 4 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





           flac employs the commonplace convention that options in a short
           version - invoked with single dash - can be shortened together
           until one that takes an argument.  Here -j and -o do, and after
           the [lq]2[rq] a whitespace is needed to start new options with
           single/double dash.  The -m option does not, and the following
           [lq]3[rq] is the -3 compression setting.  The options could
           equally well have been written out as -V -j 2 -m -3 -f -o
           Track04.flac , or as -fo Track04.flac -3mVj2.  flac also employs
           the convention that V]--R] (with whitespace!) signifies end of
           options, treating everything to follow as filename.  That is
           needed when an input filenames could otherwise be read as an op-
           tion, and [lq]-7[rq] is one such.  In total, this line takes the
           input file -7.wav as input; -o will give output filename as
           Track07.flac, and the -f will overwrite if the file Track04.flac
           is already present.  The encoder will select encoding preset -3
           modified with the -m switch, and use two CPU threads.  After-
           wards, the -V will make it decode the flac file and compare the
           audio to the input, to ensure they are indeed equal.

    Decoding examples
      V]flac --decode abc.flacR] or V]flac -d abc.flacR]
           Decode abc.flac to abc.wav.  abc.flac is not deleted.  If abc.wav
           is already present, the process will exit with an error instead
           of overwriting; use [en]force / -f to force overwrite.  NOTE: A
           mere flac abc.flac I]without [en]decode or its shortform -dR],
           would mean to re-encode abc.flac to abc.flac (see above), and
           that command would err out because abc.flac already exists.

 abc.flacR]
      V]flac -d --force-aiff-format abc.flacR] or V]flac -d -o abc.aiff
           Two different ways of decoding abc.flac to abc.aiff (AIFF for-
           mat).  abc.flac is not deleted.  -d -o could be shortened to -do.
           The decoder can force other output formats, or different versions
           of the WAVE/AIFF formats, see the options below.

      V]flac -d --keep-foreign-metadata-if-present abc.flacR]
           If the FLAC file has non-audio chunks stored from the original
           input file, this option will restore both audio and non-audio.
           The chunks will reveal the original file type, and the decoder
           will select output format and output file extension accordingly -
           note that this is not compatible with forcing a particular output
           format except if it coincides with the original, as the decoder
           cannot transcode non-audio between formats.  If there are no such
           chunks stored, it will decode to abc.wav.  The related option --
           keep-foreign-metadata will instead exit with an error if no such
           non-audio chunks are found.

      V]flac -d -F abc.flacR]
           Decode abc.flac to abc.wav and don[cq]t abort if errors are



                                    - 5 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





           found.  This is potentially useful for recovering as much as pos-
           sible from a corrupted file.  Note: Be careful about trying to
           [lq]repair[rq] files this way.  Often it will only conceal an er-
           ror, and not play any subjectively [lq]better[rq] than the cor-
           rupted file.  It is a good idea to at least keep it, and possibly
           try several decoders, including the one that generated the file,
           and hear if one has less detrimental audible errors than another.
           Make sure output volume is limited, as corrupted audio can gen-
           erate loud noises.

 OPTIONS
      A summary of options is included below.  Several of the options can be
      negated, see the B]Negative optionsR] section below.

    GENERAL OPTIONS
      B]-vR], B]--versionR]
           Show the flac version number, and quit.

      B]-hR], B]--helpR]
           Show basic usage and a list of all options, and quit.

      B]-dR], B]--decodeR]
           Decode (the default behavior is to encode)

      B]-tR], B]--testR]
           Test a flac encoded file.  This works the same as -d except no
           decoded file is written, and with some additional checks like
           parsing of all metadata blocks.

      B]-aR], B]--analyzeR]
           Analyze a FLAC encoded file.  This works the same as -d except
           the output is an analysis file, not a decoded file.

      B]-cR], B]--stdoutR]
           Write output to stdout

      B]-fR], B]--forceR]
           Force overwriting of output files.  By default, flac warns that
           the output file already exists and continues to the next file.

      B]--delete-input-fileR]
           Automatically delete the input file after a successful encode or
           decode.  If there was an error (including a verify error) the in-
           put file is left intact.

      B]-oR] I]FILENAMER], B]--output-nameR]=I]FILENAMER]
           Force the output file name (usually flac just changes the exten-
           sion).  May only be used when encoding a single file.  May not be
           used in conjunction with --output-prefix.



                                    - 6 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





      B]--output-prefixR]=I]STRINGR]
           Prefix each output file name with the given string.  This can be
           useful for encoding or decoding files to a different directory.
           Make sure if your string is a path name that it ends with a
           trailing [ga]/[cq] (slash).

      B]--preserve-modtimeR]
           (Enabled by default.) Output files have their
           timestamps/permissions set to match those of their inputs.  Use
           --no-preserve-modtime to make output files have the current time
           and default permissions.

      B]--keep-foreign-metadataR]
           If encoding, save WAVE, RF64, or AIFF non-audio chunks in FLAC
           metadata.  If decoding, restore any saved non-audio chunks from
           FLAC metadata when writing the decoded file.  Foreign metadata
           cannot be transcoded, e.g. WAVE chunks saved in a FLAC file can-
           not be restored when decoding to AIFF.  Input and output must be
           regular files (not stdin or stdout).  With this option, FLAC will
           pick the right output format on decoding.  It will exit with er-
           ror if no such chunks are found.

      B]--keep-foreign-metadata-if-presentR]
           Like --keep-foreign-metadata, but without throwing an error if
           foreign metadata cannot be found or restored.  Instead, prints a
           warning.

      B]--skipR]={#|I]MM:SSR]}
           Skip the first number of samples of the input.  To skip over a
           given initial time, specify instead minutes and seconds: there
           must then be at least one digit on each side of the colon sign.
           Fractions of a second can be specified, with locale-dependent de-
           cimal point, e.g.  --skip=123:9,867 if your decimal point is a
           comma.  A --skip option is applied to each input file if more are
           given.  This option cannot be used with -t.  When used with -a,
           the analysis file will enumerate frames from starting point.

      B]--untilR]={#|[+|]I]MM:SSR]}
           Stop at the given sample number (which is not included).  A nega-
           tive number is taken relative to the end of the audio, a
           [ga]+[cq] (plus) sign means that the --until point is taken rela-
           tive to the --skip point.  For other considerations, see --skip.

      B]--no-utf8-convertR]
           Do not convert tags from local charset to UTF-8.  This is useful
           for scripts, and setting tags in situations where the locale is
           wrong.  This option must appear before any tag options!

      B]-sR], B]--silentR]



                                    - 7 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





           Silent mode (do not write runtime encode/decode statistics to
           stderr)

      B]--totally-silentR]
           Do not print anything of any kind, including warnings or errors.
           The exit code will be the only way to determine successful com-
           pletion.

      B]-wR], B]--warnings-as-errorsR]
           Treat all warnings as errors (which cause flac to terminate with
           a non-zero exit code).

    DECODING OPTIONS
      B]-FR], B]--decode-through-errorsR]
           By default flac stops decoding with an error message and removes
           the partially decoded file if it encounters a bitstream error.
           With -F, errors are still printed but flac will continue decoding
           to completion.  Note that errors may cause the decoded audio to
           be missing some samples or have silent sections.

      B]--cueR]=[#.#][-[#.#]]
           Set the beginning and ending cuepoints to decode.  Decimal points
           are locale-dependent (dot or comma).  The optional first #.# is
           the track and index point at which decoding will start; the de-
           fault is the beginning of the stream.  The optional second #.# is
           the track and index point at which decoding will end; the default
           is the end of the stream.  If the cuepoint does not exist, the
           closest one before it (for the start point) or after it (for the
           end point) will be used.  If those don[cq]t exist , the start of
           the stream (for the start point) or end of the stream (for the
           end point) will be used.  The cuepoints are merely translated
           into sample numbers then used as --skip and --until.  A CD track
           can always be cued by, for example, --cue=9.1-10.1 for track 9,
           even if the CD has no 10th track.

      B][en]decode-chained-streamR]
           Decode all links in a chained Ogg stream, not just the first one.

      B]--apply-replaygain-which-is-not-losslessR][=I]SPECIFICATIONR]]
           Applies ReplayGain values while decoding.  B]WARNING: THIS IS NOT
           LOSSLESS.  DECODED AUDIO WILL NOT BE IDENTICAL TO THE ORIGINAL
           WITH THIS OPTION.R] This option is useful for example in tran-
           scoding media servers, where the client does not support Replay-
           Gain.  For details on the use of this option, see the section
           B]ReplayGain application specificationR].

    ENCODING OPTIONS
      Encoding will default to -5, -A [lq]tukey(5e-1)[rq] and one CPU
      thread.



                                    - 8 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





      B]-VR], B]--verifyR]
           Verify a correct encoding by decoding the output in parallel and
           comparing to the original.

      B]-0R], B]--compression-level-0R], B]--fastR]
           Fastest compression preset.  Currently synonymous with V]-l 0 -b
           1152 -r 3 --no-mid-sideR]

      B]-1R], B]--compression-level-1R]
           Currently synonymous with V]-l 0 -b 1152 -M -r 3R]

      B]-2R], B]--compression-level-2R]
           Currently synonymous with V]-l 0 -b 1152 -m -r 3R]

      B]-3R], B]--compression-level-3R]
           Currently synonymous with V]-l 6 -b 4096 -r 4 --no-mid-sideR]

      B]-4R], B]--compression-level-4R]
           Currently synonymous with V]-l 8 -b 4096 -M -r 4R]

      B]-5R], B]--compression-level-5R]
           Currently synonymous with V]-l 8 -b 4096 -m -r 5R]

      B]-6R], B]--compression-level-6R]
           Currently synonymous with V]-l 8 -b 4096 -m -r 6 -A
           [dq]subdivide_tukey(2)[dq]R]

      B]-7R], B]--compression-level-7R]
           Currently synonymous with V]-l 12 -b 4096 -m -r 6 -A
           [dq]subdivide_tukey(2)[dq]R]

      B]-8R], B]--compression-level-8R], B]--bestR]
           Currently synonymous with V]-l 12 -b 4096 -m -r 6 -A
           [dq]subdivide_tukey(3)[dq]R]

      B]-lR] #, B]--max-lpc-orderR]=#
           Specifies the maximum LPC order.  This number must be <= 32.  For
           subset streams, it must be <=12 if the sample rate is <=48kHz.
           If 0, the encoder will not attempt generic linear prediction, and
           only choose among a set of fixed (hard-coded) predictors.  Res-
           tricting to fixed predictors only is faster, but compresses weak-
           er - typically five percentage points / ten percent larger files.

      B]-bR] #, B]--blocksizeR]=#
           Specify the blocksize in samples.  The current default is 1152
           for -l 0, else 4096.  Blocksize must be between 16 and 65535 (in-
           clusive).  For subset streams it must be <= 4608 if the sam-
           plerate is <= 48kHz, for subset streams with higher samplerates
           it must be <= 16384.



                                    - 9 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





      B]-mR], B]--mid-sideR]
           Try mid-side coding for each frame (stereo only, otherwise ig-
           nored).

      B]-MR], B]--adaptive-mid-sideR]
           Adaptive mid-side coding for all frames (stereo only, otherwise
           ignored).

      B]-rR] [#,]#, B]--rice-partition-orderR]=[#,]#
           Set the [min,]max residual partition order (0..15).  For subset
           streams, max must be <=8.  min defaults to 0.  Default is -r 5.
           Actual partitioning will be restricted by block size and predic-
           tion order, and the encoder will silently reduce too high values.

      B]-AR] I]FUNCTION(S)R], B]--apodizationR]=I]FUNCTION(S)R]
           Window audio data with given apodization function.  More can be
           given, comma-separated.  See section B]Apodization functionsR]
           for details.

      B]-eR], B]--exhaustive-model-searchR]
           Do exhaustive model search (expensive!).

      B]-qR] #, B]--qlp-coeff-precisionR]=#
           Precision of the quantized linear-predictor coefficients.  This
           number must be in between 5 and 16, or 0 (the default) to let en-
           coder decide.  Does nothing if using -l 0.

      B]-pR], B]--qlp-coeff-precision-searchR]
           Do exhaustive search of LP coefficient quantization (expensive!).
           Overrides -q; does nothing if using -l 0.

      B]--laxR]
           Allow encoder to generate non-Subset files.  The resulting FLAC
           file may not be streamable or might have trouble being played in
           all players (especially hardware devices), so you should only use
           this option in combination with custom encoding options meant for
           archival.

      B]--limit-min-bitrateR]
           Limit minimum bitrate by not allowing frames consisting of only
           constant subframes.  This ensures a bitrate of at least 1
           bit/sample, for example 48kbit/s for 48kHz input.  This is mainly
           useful for internet streaming.

      B]-jR] #, B]--threadsR]=#
           Try to set a maximum number of threads to use for encoding.  If
           multithreading was not enabled on compilation or when setting a
           number of threads that is too high, this fails with a warning.
           The value of 0 means a default set by the encoder; currently that



                                   - 10 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





           is 1 thread (i.e. no multithreading), but that could change in
           the future.  Currently, up to 128 threads are supported.  Using a
           value higher than the number of available CPU threads harms per-
           formance.

      B]--ignore-chunk-sizesR]
           When encoding to flac, ignore the file size headers in WAV and
           AIFF files to attempt to work around problems with over-sized or
           malformed files.  WAV and AIFF files both specifies length of au-
           dio data with an unsigned 32-bit number, limiting audio to just
           over 4 gigabytes.  Files larger than this are malformed, but
           should be read correctly using this option.  Beware however, it
           could misinterpret any data following the audio chunk, as audio.

      B]--replay-gainR]
           Calculate ReplayGain values and store them as FLAC tags, similar
           to vorbisgain.  Title gains/peaks will be computed for each input
           file, and an album gain/peak will be computed for all files.  All
           input files must have the same resolution, sample rate, and
           number of channels.  Only mono and stereo files are allowed, and
           the sample rate must be 8, 11.025, 12, 16, 18.9, 22.05, 24, 28,
           32, 36, 37.8, 44.1, 48, 56, 64, 72, 75.6, 88.2, 96, 112, 128,
           144, 151.2, 176.4, 192, 224, 256, 288, 302.4, 352.8, 384, 448,
           512, 576, or 604.8 kHz.  Also note that this option may leave a
           few extra bytes in a PADDING block as the exact size of the tags
           is not known until all files are processed.  Note that this op-
           tion cannot be used when encoding to standard output (stdout).

      B]--cuesheetR]=I]FILENAMER]
           Import the given cuesheet file and store it in a CUESHEET metada-
           ta block.  This option may only be used when encoding a single
           file.  A seekpoint will be added for each index point in the
           cuesheet to the SEEKTABLE unless --no-cued-seekpoints is speci-
           fied.

      B]--pictureR]={I]FILENAME|SPECIFICATIONR]}
           Import a picture and store it in a PICTURE metadata block.  More
           than one --picture option can be specified.  Either a filename
           for the picture file or a more complete specification form can be
           used.  The I]SPECIFICATIONR] is a string whose parts are separat-
           ed by | (pipe) characters.  Some parts may be left empty to in-
           voke default values.  Specifying only I]FILENAMER] is just short-
           hand for [lq]||||FILENAME[rq].  See the section B]Picture speci-
           ficationR] for I]SPECIFICATIONR] format.

      B]-SR] {#|X|#x|#s}, B]--seekpointR]={#|X|#x|#s}
           Specifies point(s) to include in SEEKTABLE, to override the
           encoder[cq]s default choice of one per ten seconds (`-s 10s').
           Using #, a seek point at that sample number is added.  Using X, a



                                   - 11 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





           placeholder point is added at the end of a the table.  Using #x,
           # evenly spaced seek points will be added, the first being at
           sample 0.  Using #s, a seekpoint will be added every # seconds,
           where decimal points are locale-dependent, e.g.  `-s 9.5s' or `-s
           9,5s'.  Several -S options may be given; the resulting SEEKTABLE
           will contain all seekpoints specified (duplicates removed).
           Note: `-S #x' and `-S #s' will not work if the encoder cannot
           determine the input size before starting.  Note: if you use `-S
           #' with # being >= the number of samples in the input, there will
           be either no seek point entered (if the input size is determin-
           able before encoding starts) or a placeholder point (if input
           size is not determinable).  Use --no-seektable for no SEEKTABLE.

      B]-PR] #, B]--paddingR]=#
           (Default: 8192 bytes, although 65536 for input above 20 minutes.)
           Tell the encoder to write a PADDING metadata block of the given
           length (in bytes) after the STREAMINFO block.  This is useful for
           later tagging, where one can write over the PADDING block instead
           of having to rewrite the entire file.  Note that a block header
           of 4 bytes will come on top of the length specified.

      B]-TR] [lq]I]FIELD=VALUER][rq]B], --tagR]=[lq]I]FIELD=VALUER][rq]
           Add a FLAC tag.  The comment must adhere to the Vorbis comment
           spec; i.e. the FIELD must contain only legal characters, ter-
           minated by an `equals' sign.  Make sure to quote the content if
           necessary.  This option may appear more than once to add several
           Vorbis comments.  NOTE: all tags will be added to all encoded
           files.

      B]--tag-from-fileR]=[lq]I]FIELD=FILENAMER][rq]
           Like --tag, except FILENAME is a file whose contents will be read
           verbatim to set the tag value.  The contents will be converted to
           UTF-8 from the local charset.  This can be used to store a
           cuesheet in a tag (e.g. --tag-from-
           file=[lq]CUESHEET=image.cue[rq]).  Do not try to store binary
           data in tag fields!  Use APPLICATION blocks for that.

    FORMAT OPTIONS
      Encoding defaults to FLAC and not OGG.  Decoding defaults to WAVE
      (more specifically WAVE_FORMAT_PCM for mono/stereo with 8/16 bits, and
      to WAVE_FORMAT_EXTENSIBLE otherwise), except: will be overridden by
      chunks found by --keep-foreign-metadata-if-present or --keep-foreign-
      metadata

      B]--oggR]
           When encoding, generate Ogg FLAC output instead of native FLAC.
           Ogg FLAC streams are FLAC streams wrapped in an Ogg transport
           layer.  The resulting file should have an `.oga' extension and
           will still be decodable by flac.  When decoding, force the input



                                   - 12 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





           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'.

      B]--serial-numberR]=#
           When used with --ogg, specifies the serial number to use for the
           first Ogg FLAC stream, which is then incremented for each addi-
           tional stream.  When encoding and no serial number is given, flac
           uses a random number for the first stream, then increments it for
           each additional stream.  When decoding and no number is given,
           flac uses the serial number of the first page.

      B]--force-aiff-formatR]
      B]--force-rf64-formatR]
      B]--force-wave64-formatR] : For decoding: Override default output for-
      mat and force output to AIFF/RF64/WAVE64, respectively.  This option
      is not needed if the output filename (as set by -o) ends with I].aifR]
      or I].aiffR], I].rf64R] and I].w64R] respectively.  The encoder auto-
      detects format and ignores this option.

      B]--force-legacy-wave-formatR]
      B]--force-extensible-wave-formatR] : Instruct the decoder to output a
      WAVE file with WAVE_FORMAT_PCM and WAVE_FORMAT_EXTENSIBLE respective-
      ly, overriding default choice.

      B]--force-aiff-c-none-formatR]
      B]--force-aiff-c-sowt-formatR] : Instruct the decoder to output an
      AIFF-C file with format NONE and sowt respectively.

      B]--force-raw-formatR]
           Force input (when encoding) or output (when decoding) to be
           treated as raw samples (even if filename suggests otherwise).

    raw format options
      When encoding from or decoding to raw PCM, format must be specified.

      B]--signR]={signed|unsigned}
           Specify the sign of samples.

      B]--endianR]={big|little}
           Specify the byte order for samples

      B]--channelsR]=#
           (Input only) specify number of channels.  The channels must be
           interleaved, and in the order of the FLAC format (see the format
           specification); the encoder (/decoder) cannot re-order channels.

      B]--bpsR]=#
           (Input only) specify bits per sample (per channel: 16 for CDDA.)




                                   - 13 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





      B]--sample-rateR]=#
           (Input only) specify sample rate (in Hz.  Only integers support-
           ed.)

      B]--input-sizeR]=#
           (Input only) specify the size of the raw input in bytes.  This
           option is only compulsory when encoding from stdin and using op-
           tions that need to know the input size beforehand (like, --skip,
           --until, --cuesheet ) The encoder will truncate at the specified
           size if the input stream is bigger.  If the input stream is
           smaller, it will complain about an unexpected end-of-file.

    ANALYSIS OPTIONS
      B]--residual-textR]
           Includes the residual signal in the analysis file.  This will
           make the file very big, much larger than even the decoded file.

      B]--residual-gnuplotR]
           Generates a gnuplot file for every subframe; each file will con-
           tain the residual distribution of the subframe.  This will create
           a lot of files.  gnuplot must be installed separately.

    NEGATIVE OPTIONS
      The following will negate an option previously given:

      B]--no-adaptive-mid-sideR]
      B]--no-cued-seekpointsR]
      B]--no-decode-through-errorsR]
      B]--no-delete-input-fileR]
      B]--no-preserve-modtimeR]
      B]--no-keep-foreign-metadataR]
      B]--no-exhaustive-model-searchR]
      B]--no-forceR]
      B]--no-laxR]
      B]--no-mid-sideR]
      B]--no-oggR]
      B]--no-paddingR]
      B]--no-qlp-coeff-prec-searchR]
      B]--no-replay-gainR]
      B]--no-residual-gnuplotR]
      B]--no-residual-textR]
      B]--no-seektableR]
      B]--no-silentR]
      B]--no-verifyR]
      B]--no-warnings-as-errorsR]

    ReplayGain application specification
      The option --apply-replaygain-which-is-not-lossless[=<specification>]
      applies ReplayGain values while decoding.  B]WARNING: THIS IS NOT



                                   - 14 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





      LOSSLESS.  DECODED AUDIO WILL NOT BE IDENTICAL TO THE ORIGINAL WITH
      THIS OPTION.R] This option is useful for example in transcoding media
      servers, where the client does not support ReplayGain.

      The <specification> is a shorthand notation for describing how to ap-
      ply ReplayGain.  All elements are optional - defaulting to 0aLn1 - but
      order is important.  The format is:

      [<preamp>][a|t][l|L][n{0|1|2|3}]

      In which the following parameters are used:

      [bu]
        B]preampR]: A floating point number in dB.  This is added to the ex-
        isting gain value.

      [bu]
        B]a|tR]: Specify `a' to use the album gain, or `t' to use the track
        gain.  If tags for the preferred kind (album/track) do not exist but
        tags for the other (track/album) do, those will be used instead.

      [bu]
        B]l|LR]: Specify `l' to peak-limit the output, so that the Replay-
        Gain peak value is full-scale.  Specify `L' to use a 6dB hard lim-
        iter that kicks in when the signal approaches full-scale.

      [bu]
        B]n{0|1|2|3}R]: Specify the amount of noise shaping.  ReplayGain
        synthesis happens in floating point; the result is dithered before
        converting back to integer.  This quantization adds noise.  Noise
        shaping tries to move the noise where you won[cq]t hear it as much.
        0 means no noise shaping, 1 means `low', 2 means `medium', 3 means
        `high'.

      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[cq]t be parsed, decoding will
      continue with a warning, and no ReplayGain is applied to that stream.

    Picture specification
      This described the specification used for the B]--pictureR] option.
      [I]TYPER]]|[I]MIME-
      TYPER]]|[I]DESCRIPTIONR]]|[I]WIDTHxHEIGHTxDEPTHR][/I]COLORSR]]]|I]FILER]

      I]TYPER] is optional; it is a number from one of:



                                   - 15 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





       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.

      I]MIME-TYPER] 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



                                   - 16 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





      discouraged.

      I]DESCRIPTIONR] is optional; the default is an empty string.

      The next part specifies the resolution and color information.  If the
      I]MIME-TYPER] 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.

      I]FILER] is the path to the picture file to be imported, or the URL if
      MIME type is -->

      B]Specification examples:R] [lq]|image/jpeg|||../cover.jpg[rq] will
      embed the JPEG file at ../cover.jpg, defaulting to type 3 (front cov-
      er) and an empty description.  The resolution and color info will be
      retrieved from the file itself.  [lq]4|--
      >|CD|320x300x24/173|http://blah.blah/backcover.tiff[rq] will embed the
      given URL, with type 4 (back cover), description [lq]CD[rq], 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.

    Apodization functions
      To improve LPC analysis, the audio data is windowed.  An B]-AR] option
      applies the specified apodization function(s) instead of the default
      (which is [lq]tukey(5e-1)[rq], though different for presets -6 to -8.)
      Specifying one more function effectively means, for each subframe, to
      try another weighting of the data and see if it happens to result in a
      smaller encoded subframe.  Specifying several functions is time-
      expensive, at typically diminishing compression gains.

      The subdivide_tukey(I]NR]) functions (see below) used in presets -6 to
      -8 were developed to recycle calculations for speed, compared to using
      a number of independent functions.  Even then, a high number like
      I]NR]>4 or 5, will often become less efficient than other options con-
      sidered expensive, like the slower -p, though results vary with sig-
      nal.

      Up to 32 functions can be given as comma-separated list and/or indivi-
      dual B]-AR] options.  Any mis-specified function is silently ignored.
      Quoting a function which takes options (and has parentheses) may be
      necessary, depending on shell.  Currently the following functions are
      implemented: bartlett, bartlett_hann, blackman,
      blackman_harris_4term_92db, connes, flattop, gauss(I]STDDEVR]), ham-
      ming, hann, kaiser_bessel, nuttall, rectangle, triangle, tukey(I]PR]),
      partial_tukey(I]NR][/I]OVR][/I]PR]]]),



                                   - 17 -      Formatted:  February 22, 2025






 flac(1)                        Version 1.5.0                        flac(1)
 Free Lossless Audio Codec conversiFreeoLossless Audio Codec conversion tool





      punchout_tukey(I]NR][/I]OVR][/I]PR]]]),
      subdivide_tukey(I]NR][/I]PR]]), welch.

      For parameters I]PR], I]STDDEVR] and I]OVR], scientific notation is
      supported, e.g.  tukey(5e-1).  Otherwise, the decimal point must agree
      with the locale, e.g. tukey(0.5) or tukey(0,5) depending on your sys-
      tem.

      [bu]
        For gauss(I]STDDEVR]), I]STDDEVR] is the standard deviation
        (0<I]STDDEVR]<=5e-1).

      [bu]
        For tukey(I]PR]), I]PR] (between 0 and 1) specifies the fraction of
        the window that is cosine-tapered; I]PR]=0 corresponds to
        [lq]rectangle[rq] and I]PR]=1 to [lq]hann[rq].

      [bu]
        partial_tukey(I]NR]) and punchout_tukey(I]NR]) are largely obsoleted
        by the more time-effective subdivide_tukey(I]NR]), see next item.
        They generate I]NR] functions each spanning a part of each block.
        Optional arguments are an overlap I]OVR] (<1, may be negative), for
        example partial_tukey(2/2e-1); and then a taper parameter I]PR], for
        example partial_tukey(2/2e-1/5e-1).

      [bu]
        subdivide_tukey(I]NR]) is a more efficient reimplementation of
        partial_tukey and punchout_tukey taken together, combining the win-
        dows they would generate up to the specified I]NR].  Specifying
        subdivide_tukey(3) entails a tukey, a partial_tukey(2), a
        partial_tukey(3) and a punchout_tukey(3); specifying
        subdivide_tukey(5) will on top of that add a partial_tukey(4), a
        punchout_tukey(4), a partial_tukey(5) and a punchout_tukey(5) - but
        all with tapering chosen to facilitate the re-use of computation.
        Thus the I]PR] parameter (defaulting to 5e-1) is applied for the
        smallest used window: For example, subdivide_tukey(2/5e-1) results
        in the same taper as that of tukey(25e-2) and subdivide_tukey(5) in
        the same taper as of tukey(1e-1).

 SEE ALSO
      B]metaflac(1)R]

 AUTHOR
      This manual page was initially written by Matt Zimmerman
      <mdz[at]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.






                                   - 18 -      Formatted:  February 22, 2025