Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: FLAC - documentation Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
Chris@1: Chris@1: Chris@1: Chris@1:
Chris@1:  english  | Chris@1:  russian  Chris@1:
Chris@1: Chris@1:
Chris@1: Chris@1:
Chris@1:
Chris@1: metaflac Chris@1:
Chris@1:
Chris@1:
Chris@1: Table of Contents Chris@1: Chris@1: General Usage
Chris@1:
Chris@1: metaflac is the command-line .flac file metadata editor. You can use it to list the contents of metadata blocks, edit, delete or insert blocks, and manage padding.
Chris@1:
Chris@1: metaflac takes a set of "options" (though some are not optional) and a set of FLAC files to operate on. There are three kinds of "options": Chris@1: Chris@1: All of these are described in the tables below. At least one shorthand or major operation must be supplied. You can use multiple shorthand operations to do more than one thing to a file or set of files. Most of the common things to do to metadata have shorthand operations. As an example, here is how to show the MD5 signatures for a set of three FLAC files:
Chris@1:
Chris@1: metaflac --show-md5sum file1.flac file2.flac file3.flac
Chris@1:
Chris@1: Another example; this removes all DESCRIPTION and COMMENT tags in a set of FLAC files, and uses the --preserve-modtime global option to keep the FLAC file modification times the same (usually when files are edited the modification time is set to the current time):
Chris@1:
Chris@1: metaflac --preserve-modtime --remove-tag=DESCRIPTION --remove-tag=COMMENT file1.flac file2.flac file3.flac
Chris@1:
Chris@1: Chris@1:
Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
Chris@1: Global Options Chris@1:
Chris@1: Chris@1: --preserve-modtime Chris@1: Chris@1: Preserve the original modification time in spite of edits. Chris@1:
Chris@1: Chris@1: --with-filename Chris@1: Chris@1: Prefix each output line with the FLAC file name (the default if more than one FLAC file is specified). Chris@1:
Chris@1: Chris@1: --no-filename Chris@1: Chris@1: Do not prefix each output line with the FLAC file name (the default if only one FLAC file is specified) Chris@1:
Chris@1: Chris@1: --no-utf8-convert Chris@1: Chris@1: Do not convert tags from UTF-8 to local charset, or vice versa. This is useful for scripts, and setting tags in situations where the locale is wrong. Chris@1:
Chris@1: Chris@1: --dont-use-padding Chris@1: Chris@1: By default metaflac tries to use padding where possible to avoid rewriting the entire file if the metadata size changes. Use this option to tell metaflac to not take advantage of padding this way. Chris@1:
Chris@1:
Chris@1: Chris@1:
Chris@1: Chris@1:
Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
Chris@1: Shorthand Operations Chris@1:
Chris@1: Chris@1: --show-md5sum Chris@1: Chris@1: Show the MD5 signature from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-min-blocksize Chris@1: Chris@1: Show the minimum block size from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-max-blocksize Chris@1: Chris@1: Show the maximum block size from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-min-framesize Chris@1: Chris@1: Show the minimum frame size from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-max-framesize Chris@1: Chris@1: Show the maximum frame size from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-sample-rate Chris@1: Chris@1: Show the sample rate from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-channels Chris@1: Chris@1: Show the number of channels from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-bps Chris@1: Chris@1: Show the # of bits per sample from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-total-samples Chris@1: Chris@1: Show the total # of samples from the STREAMINFO block. Chris@1:
Chris@1: Chris@1: --show-vendor-tag Chris@1: Chris@1: Show the vendor string from the VORBIS_COMMENT block. Chris@1:
Chris@1: Chris@1: --show-tag=NAME Chris@1: Chris@1: Show all tags where the the field name matches NAME. Chris@1:
Chris@1: Chris@1: --remove-tag=NAME Chris@1: Chris@1: Remove all tags whose field name is NAME. Chris@1:
Chris@1: Chris@1: --remove-first-tag=NAME Chris@1: Chris@1: Remove first tag whose field name is NAME. Chris@1:
Chris@1: Chris@1: --remove-all-tags Chris@1: Chris@1: Remove all tags, leaving only the vendor string. Chris@1:
Chris@1: Chris@1: --set-tag=FIELD Chris@1: Chris@1: Add a tag. The FIELD must comply with the Vorbis comment spec, of the form NAME=VALUE. If there is currently no tag block, one will be created. Chris@1:
Chris@1: Chris@1: --set-tag-from-file=FIELD Chris@1: Chris@1: Like --set-tag, except the VALUE is a filename whose contents will be read verbatim to set the tag value. Unless --no-utf8-convert is specified, 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. --set-tag-from-file="CUESHEET=image.cue"). Do not try to store binary data in tag fields! Use APPLICATION blocks for that. Chris@1:
Chris@1: Chris@1: --import-tags-from=FILE Chris@1: Chris@1: Import tags from a file. Use - for stdin. Each line should be of the form NAME=VALUE. Multi-line comments are currently not supported. Specify --remove-all-tags and/or --no-utf8-convert before --import-tags-from if necessary. If FILE is - (stdin), only one FLAC file may be specified. Chris@1:
Chris@1: Chris@1: --export-tags-to=FILE Chris@1: Chris@1: Export tags to a file. Use - for stdin. Each line will be of the form NAME=VALUE. Specify --no-utf8-convert if necessary. Chris@1:
Chris@1: Chris@1: --import-cuesheet-from=FILE Chris@1: Chris@1: Import a cuesheet from a file. Use - for stdin. Only one FLAC file may be specified. A seekpoint will be added for each index point in the cuesheet to the SEEKTABLE unless --no-cued-seekpoints is specified. Chris@1:
Chris@1: Chris@1: --export-cuesheet-to=FILE Chris@1: Chris@1: Export CUESHEET block to a cuesheet file, suitable for use by CD authoring software. Use - for stdout. Only one FLAC file may be specified on the command line. Chris@1:
Chris@1: Chris@1: --import-picture-from={FILENAME|SPECIFICATION} Chris@1: Chris@1: Import a picture and store it in a PICTURE metadata block. See the flac option --picture for an explanation of the SPECIFICATION syntax. Chris@1:
Chris@1: Chris@1: --export-picture-to=FILE Chris@1: Chris@1: Export PICTURE block to a file. Use - for stdout. Only one FLAC file may be specified on the command line. The first PICTURE block will be exported unless --export-picture-to is preceded by a --block-number=# option to specify the exact metadata block to extract. Note that the block number is the one shown by --list. Chris@1:
Chris@1: Chris@1: --add-replay-gain Chris@1: Chris@1: Calculates the title and album gains/peaks of the given FLAC files as if all the files were part of one album, then stores them as FLAC tags. The tags are the same as those used by vorbisgain. Existing ReplayGain tags will be replaced. If only one FLAC file is given, the album and title gains will be the same. Since this operation requires two passes, it is always executed last, after all other operations have been completed and written to disk. All FLAC files specified must have the same resolution, sample rate, and number of channels. The sample rate must be one of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, or 48 kHz. Chris@1:
Chris@1: Chris@1: --remove-replay-gain Chris@1: Chris@1: Removes the ReplayGain tags. Chris@1:
Chris@1: Chris@1: --add-seekpoint={#|X|#x|#s} Chris@1: Chris@1: Add seek points to a SEEKTABLE block:
Chris@1:
    Chris@1:
  • Chris@1: : a specific sample number for a seek point Chris@1:
  • Chris@1:
  • Chris@1: : a placeholder point (always goes at the end of the SEEKTABLE) Chris@1:
  • Chris@1:
  • Chris@1: #x : # evenly spaced seekpoints, the first being at sample 0 Chris@1:
  • Chris@1:
  • Chris@1: #s : a seekpoint every # seconds; # does not have to be a whole number, it can be, for example, 9.5, meaning a seekpoint every 9.5 seconds Chris@1:
  • Chris@1:
Chris@1: If no SEEKTABLE block exists, one will be created. If one already exists, points will be added to the existing table, and any duplicates will be turned into placeholder points.
Chris@1: You may use many --add-seekpoint options; the resulting SEEKTABLE will be the unique-ified union of all such values. Example: --add-seekpoint=100x --add-seekpoint=3.5s will add 100 evenly spaced seekpoints and a seekpoint every 3.5 seconds.
Chris@1:
Chris@1: Chris@1: --add-padding=# Chris@1: Chris@1: Add a padding block of the given length (in bytes). The overall length of the new block will be 4 + length; the extra 4 bytes is for the metadata block header. Chris@1:
Chris@1:
Chris@1: Chris@1:
Chris@1: Chris@1:
Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
Chris@1: Major Operations Chris@1:
Chris@1: Chris@1: --version Chris@1: Chris@1: Show the metaflac version number. Chris@1:
Chris@1: Chris@1: --list Chris@1: Chris@1: List the contents of one or more metadata blocks to stdout. By default, all metadata blocks are listed in text format. Use the following options to change this behavior:
Chris@1:
Chris@1: Chris@1: --block-number=#[,#[...]]
Chris@1: An optional comma-separated list of block numbers to display. The first block, the STREAMINFO block, is block 0.
Chris@1:
Chris@1: Chris@1: --block-type=type[,type[...]]
Chris@1: --except-block-type=type[,type[...]]
Chris@1: An optional comma-separated list of block types to be included or ignored with this option. Use only one of --block-type or --except-block-type. The valid block types are: STREAMINFO, PADDING, APPLICATION, SEEKTABLE, VORBIS_COMMENT. You may narrow down the types of APPLICATION blocks displayed as follows:
Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
APPLICATION:abcdThe APPLICATION block(s) whose textual representation of the 4-byte ID is "abcd"
APPLICATION:0xXXXXXXXXThe APPLICATION block(s) whose hexadecimal big- endian representation of the 4-byte ID is "0xXXXXXXXX". For the example "abcd" above the hexadecimal equivalalent is 0x61626364
Chris@1:
Chris@1: Chris@1: NOTE: if both --block-number and --[except-]block-type are specified, the result is the logical AND of both arguments.
Chris@1:
Chris@1: Chris@1: --application-data-format=hexdump|text
Chris@1: If the application block you are displaying contains binary data but your --data-format=text, you can display a hex dump of the application data contents instead using --application-data-format=hexdump. Chris@1:
Chris@1: Chris@1: --remove Chris@1: Chris@1: Remove one or more metadata blocks from the metadata. Unless --dont-use-padding is specified, the blocks will be replaced with padding. You may not remove the STREAMINFO block.
Chris@1:
Chris@1: Chris@1: --block-number=#[,#[...]]
Chris@1: --block-type=type[,type[...]]
Chris@1: --except-block-type=type[,type[...]]
Chris@1: See --list above for usage.
Chris@1:
Chris@1: Chris@1: NOTE: if both --block-number and --[except-]block-type are specified, the result is the logical AND of both arguments. Chris@1:
Chris@1: Chris@1: --remove-all Chris@1: Chris@1: Remove all metadata blocks (except the STREAMINFO block) from the metadata. Unless --dont-use-padding is specified, the blocks will be replaced with padding. Chris@1:
Chris@1: Chris@1: --merge-padding Chris@1: Chris@1: Merge adjacent PADDING blocks into single blocks. Chris@1:
Chris@1: Chris@1: --sort-padding Chris@1: Chris@1: Move all PADDING blocks to the end of the metadata and merge them into a single block. Chris@1:
Chris@1:
Chris@1: Chris@1:
Chris@1: Option Index
Chris@1:
Chris@1: --add-padding
Chris@1: --add-replay-gain
Chris@1: --add-seekpoint
Chris@1: --dont-use-padding
Chris@1: --export-cuesheet-to
Chris@1: --export-picture-to
Chris@1: --export-tags-to
Chris@1: --import-cuesheet-from
Chris@1: --import-picture-from
Chris@1: --import-tags-from
Chris@1: --list
Chris@1: --merge-padding
Chris@1: --no-filename
Chris@1: --no-utf8-convert
Chris@1: --preserve-modtime
Chris@1: --remove-all-tags
Chris@1: --remove-all
Chris@1: --remove-first-tag
Chris@1: --remove-replay-gain
Chris@1: --remove-tag
Chris@1: --remove
Chris@1: --set-tag-from-file
Chris@1: --set-tag
Chris@1: --show-bps
Chris@1: --show-channels
Chris@1: --show-max-blocksize
Chris@1: --show-max-framesize
Chris@1: --show-md5sum
Chris@1: --show-min-blocksize
Chris@1: --show-min-framesize
Chris@1: --show-sample-rate
Chris@1: --show-tag
Chris@1: --show-total-samples
Chris@1: --show-vendor-tag
Chris@1: --sort-padding
Chris@1: --version
Chris@1: --with-filename
Chris@1: Chris@1:
Chris@1: Chris@1:
Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: