<spanclass="commandname">metaflac</span> is the command-line <spanclass="code">.flac</span> file metadata editor. You can use it to list the contents of metadata blocks, edit, delete or insert blocks, and manage padding.<br/>
<br/>
<spanclass="commandname">metaflac</span> 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":
<ul>
<li>
Major operations, which specify a mode of operation like listing blocks, removing blocks, etc. These will have sub-operations describing exactly what is to be done.
</li>
<li>
Shorthand operations, which are convenient synonyms for major operations. For example, there is a shorthand operation <spanclass="argument">--show-sample-rate</span> that shows just the sample rate field from the <spanclass="code">STREAMINFO</span> metadata block.
</li>
<li>
Global options, which affect all the operations.
</li>
</ul>
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:<br/>
Another example; this removes all DESCRIPTION and COMMENT tags in a set of FLAC files, and uses the <spanclass="argument">--preserve-modtime</span> 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):<br/>
By default <spanclass="commandname">metaflac</span> 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.
Add a tag. The <spanclass="argument">FIELD</span> must comply with the Vorbis comment spec, of the form <spanclass="argument">NAME=VALUE</span>. If there is currently no tag block, one will be created.
Like <ahref="#metaflac_shorthand_set_tag"><spanclass="argument">--set-tag</span></a>, except the VALUE is a filename whose contents will be read verbatim to set the tag value. Unless <ahref="#metaflac_options_no_utf8_convert"><spanclass="argument">--no-utf8-convert</span></a> 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. <spanclass="argument">--set-tag-from-file="CUESHEET=image.cue"</span>). Do not try to store binary data in tag fields! Use APPLICATION blocks for that.
Import tags from a file. Use <spanclass="argument">-</span> for stdin. Each line should be of the form <spanclass="argument">NAME=VALUE</span>. Multi-line comments are currently not supported. Specify <spanclass="argument">--remove-all-tags</span> and/or <ahref="#metaflac_options_no_utf8_convert"><spanclass="argument">--no-utf8-convert</span></a> before <spanclass="argument">--import-tags-from</span> if necessary. If <spanclass="argument">FILE</span> is <spanclass="argument">-</span> (stdin), only one FLAC file may be specified.
Export tags to a file. Use <spanclass="argument">-</span> for stdin. Each line will be of the form <spanclass="argument">NAME=VALUE</span>. Specify <ahref="#metaflac_options_no_utf8_convert"><spanclass="argument">--no-utf8-convert</span></a> if necessary.
Import a cuesheet from a file. Use <spanclass="argument">-</span> for stdin. Only one FLAC file may be specified. A seekpoint will be added for each index point in the cuesheet to the <spanclass="code">SEEKTABLE</span> unless <spanclass="argument">--no-cued-seekpoints</span> is specified.
Export <spanclass="code">CUESHEET</span> block to a cuesheet file, suitable for use by CD authoring software. Use <spanclass="argument">-</span> for stdout. Only one FLAC file may be specified on the command line.
Import a picture and store it in a <ahref="format.html#def_PICTURE"><spanclass="code">PICTURE</span></a> metadata block. See the <spanclass="commandname">flac</span> option <spanclass="argument"><ahref="documentation_tools_flac.html#flac_options_picture">--picture</a></span> for an explanation of the <spanclass="argument">SPECIFICATION</span> syntax.
Export <spanclass="code">PICTURE</span> block to a file. Use <spanclass="argument">-</span> for stdout. Only one FLAC file may be specified on the command line. The first <spanclass="code">PICTURE</span> block will be exported unless <spanclass="argument">--export-picture-to</span> is preceded by a <spanclass="argument">--block-number=#</span> option to specify the exact metadata block to extract. Note that the block number is the one shown by --list.
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 in the <spanclass="code">VORBIS_COMMENT</span> block. The tags are the same as those used by <spanclass="commandname">vorbisgain</span>. 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.
Add seek points to a <spanclass="code">SEEKTABLE</span> block:<br/>
<ul>
<li>
<spanclass="argument"># </span> : a specific sample number for a seek point
</li>
<li>
<spanclass="argument">X </span> : a placeholder point (always goes at the end of the <spanclass="code">SEEKTABLE</span>)
</li>
<li>
<spanclass="argument">#x</span> : # evenly spaced seekpoints, the first being at sample 0
</li>
<li>
<spanclass="argument">#s</span> : a seekpoint every # seconds; # does not have to be a whole number, it can be, for example, <spanclass="argument">9.5</span>, meaning a seekpoint every 9.5 seconds
</li>
</ul>
If no <spanclass="code">SEEKTABLE</span> 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.<br/>
You may use many <spanclass="argument">--add-seekpoint</span> options; the resulting <spanclass="code">SEEKTABLE</span> will be the unique-ified union of all such values. Example: <spanclass="argument">--add-seekpoint=100x --add-seekpoint=3.5s</span> will add 100 evenly spaced seekpoints and a seekpoint every 3.5 seconds.<br/>
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.
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:<br/>
An optional comma-separated list of block types to be included or ignored with this option. Use only one of <spanclass="argument">--block-type</span> or <spanclass="argument">--except-block-type</span>. The valid block types are: <spanclass="code">STREAMINFO</span>, <spanclass="code">PADDING</span>, <spanclass="code">APPLICATION</span>, <spanclass="code">SEEKTABLE</span>, <spanclass="code">VORBIS_COMMENT</span>. You may narrow down the types of <spanclass="code">APPLICATION</span> blocks displayed as follows:<br/>
<td>The <spanclass="code">APPLICATION</span> block(s) whose hexadecimal big- endian representation of the 4-byte ID is "0xXXXXXXXX". For the example "abcd" above the hexadecimal equivalalent is 0x61626364</td>
</tr>
</table>
<br/>
NOTE: if both <spanclass="argument">--block-number</span> and <spanclass="argument">--[except-]block-type</span> are specified, the result is the logical AND of both arguments.<br/>
If the application block you are displaying contains binary data but your <spanclass="argument">--data-format=text</span>, you can display a hex dump of the application data contents instead using <spanclass="argument">--application-data-format=hexdump</span>.
Remove one or more metadata blocks from the metadata. Unless <spanclass="argument">--dont-use-padding</span> is specified, the blocks will be replaced with padding. You may not remove the <spanclass="code">STREAMINFO</span> block.<br/>
See <ahref="#metaflac_operations_list"><spanclass="argument">--list</span></a> above for usage.<br/>
<br/>
NOTE: if both <spanclass="argument">--block-number</span> and <spanclass="argument">--[except-]block-type</span> are specified, the result is the logical AND of both arguments.
Remove all metadata blocks (except the <spanclass="code">STREAMINFO</span> block) from the metadata. Unless <spanclass="argument">--dont-use-padding</span> is specified, the blocks will be replaced with padding.