metaflac(1)
metaflac β the FLAC metadata glow-up station π β¨
okay so bestie, meet metaflac, the Free Lossless Audio Codec metadata tool. she is that girl: a command-line program who lists, adds, removes, or edits metadata in one or more FLAC files. manual page one, section one, and honestly? iconic.
β¨ NAME β¨
metaflac β program to list, add, remove, or edit metadata in one or more FLAC files.
π SYNOPSIS π
metaflac [ options ] [ operations ] FLACfile ...
π DESCRIPTION π
Use metaflac to list, add, remove, or edit metadata in one or more FLAC files. You may perform one major operation, or many shorthand operations at a time.
like, one big thing OR a whole bunch of little things, your call, she's flexible π¦
πΈ GENERAL USAGE πΈ
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.
metaflac takes a set of "options" (though some are not optional, and yes that's a little unhinged of her) and a set of FLAC files to operate on. There are three kinds of "options":
- Major operations β these specify a mode of operation, like listing blocks, removing blocks, etc. They come with sub-operations that describe exactly what is to be done.
- Shorthand operations β convenient synonyms for major operations. For example, there is a shorthand operation
--show-sample-ratethat shows just the sample rate field from theSTREAMINFOmetadata block. - Global options β these affect all the operations.
All of these are described in the tables below (yes, tables, we're fancy). At least one shorthand or major operation must be supplied β she needs something to do, bestie. 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:
metaflac --show-md5sum file1.flac file2.flac file3.flac
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):
metaflac --preserve-modtime --remove-tag=DESCRIPTION --remove-tag=COMMENT file1.flac file2.flac file3.flac
π OPTIONS π
-o filename,--output-name=filenameβ Output to a new file instead of changing or rewriting the input file. so she makes a copy instead of touching the original, we love a considerate queen--preserve-modtimeβ Preserve the original modification time in spite of edits. This does nothing when-oor--output-nameare specified. ngl she's not gonna preserve anything if you already told her to write somewhere else--with-filenameβ Prefix each output line with the FLAC file name (the default if more than one FLAC file is specified). This option has no effect for options exporting to a file, like--export-tags-to. it's giving "who said that" energy for every line--no-filenameβ Do not prefix each output line with the FLAC file name (the default if only one FLAC file is specified).--no-utf8-convertβ 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. scripts stay winning fr fr--dont-use-paddingβ By defaultmetaflactries to use padding where possible to avoid rewriting the entire file if the metadata size changes. Use this option to tellmetaflacto not take advantage of padding this way. she'd rather rewrite the whole thing, no shortcuts, main character behavior
π¦ SHORTHAND OPERATIONS π¦
okay bestie, this is the big list. every single one, no skips, we're not doing that here π
--show-md5sumβ Show the MD5 signature from theSTREAMINFOblock.--show-min-blocksizeβ Show the minimum block size from theSTREAMINFOblock.--show-max-blocksizeβ Show the maximum block size from theSTREAMINFOblock.--show-min-framesizeβ Show the minimum frame size from theSTREAMINFOblock.--show-max-framesizeβ Show the maximum frame size from theSTREAMINFOblock.--show-sample-rateβ Show the sample rate from theSTREAMINFOblock.--show-channelsβ Show the number of channels from theSTREAMINFOblock.--show-bpsβ Show the # of bits per sample from theSTREAMINFOblock.--show-total-samplesβ Show the total # of samples from theSTREAMINFOblock.--show-vendor-tagβ Show the vendor string from theVORBIS_COMMENTblock.--show-tag=nameβ Show all tags where the field name matchesname.--show-all-tagsβ Show all tags. This is an alias for--export-tags-to=-. same energy, different name π«--remove-tag=nameβ Remove all tags whose field name isname.--remove-first-tag=nameβ Remove first tag whose field name isname. just the first one bestie, she's being specific--remove-all-tagsβ Remove all tags, leaving only the vendor string. it's a full reset, no survivors except the vendor string π--remove-all-tags-except=NAME1[=NAME2[=...]]β Remove all tags, except the vendor string and the tag names specified. Tag names must be separated by an=character.--set-tag=fieldβ 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. she'll manifest one for you, no worries--set-tag-from-file=fieldβ Like--set-tag, except theVALUEis a filename whose contents will be read verbatim to set the tag value. Unless--no-utf8-convertis 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. she is literally begging you. binary in a tag field is not the vibe.
--import-tags-from=fileβ Import tags from a file. Use-for stdin. Each line should be of the formNAME=VALUE. Multi-line comments are currently not supported. Specify--remove-all-tagsand/or--no-utf8-convertbefore--import-tags-fromif necessary. IfFILEis-(stdin), only one FLAC file may be specified. order matters here, put those before, okay?--export-tags-to=fileβ Export tags to a file. Use-for stdout. Each line will be of the formNAME=VALUE. Specify--no-utf8-convertif necessary.--import-cuesheet-from=fileβ 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 theSEEKTABLEunless--no-cued-seekpointsis specified.--export-cuesheet-to=fileβ ExportCUESHEETblock 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. one file. ONE. don't test her--import-picture-from={FILENAME|SPECIFICATION}β Import a picture and store it in aPICTUREmetadata block. More than one--import-picture-fromcommand can be specified. Either a filename for the picture file or a more complete specification form can be used. TheSPECIFICATIONis a string whose parts are separated by|(pipe) characters. Some parts may be left empty to invoke default values.FILENAMEis just shorthand for "||||FILENAME". For details on the specification, see the section Picture specification in theflac(1)man page. she's got lore, go read the flac(1) page bestie--export-picture-to=fileβ ExportPICTUREblock to a file. Use-for stdout. Only one FLAC file may be specified on the command line. The firstPICTUREblock will be exported unless--export-picture-tois 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.--add-replay-gainβ 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 byvorbisgain. 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. 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. that whole list is non-negotiable, she checked twice β¨--scan-replay-gainβ Like--add-replay-gain, but only analyzes the files rather than writing them to the tags. just looking, not touching π--remove-replay-gainβ Removes the ReplayGain tags.--add-seekpoint={#|X|#x|#s}β Add seek points to aSEEKTABLEblock. Using#, a seek point at that sample number is added. UsingX, a 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 (#does not have to be a whole number; it can be, for example,9.5, meaning a seekpoint every 9.5 seconds). If noSEEKTABLEblock 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. You may use many--add-seekpointoptions; the resultingSEEKTABLEwill be the unique-ified union of all such values. Example:--add-seekpoint=100x --add-seekpoint=3.5swill add 100 evenly spaced seekpoints and a seekpoint every 3.5 seconds. unique-ified union, she said what she said π--add-padding=lengthβ Add a padding block of the given length (in bytes). The overall length of the new block will be4 + length; the extra 4 bytes is for the metadata block header.
β¦and bestie, we are literally not even done yet π
π₯ MAJOR OPERATIONS π₯
These are the big-girl moves. The ones that actually change stuff. Buckle up bestie π
--listβ Spills the contents of one or more metadata blocks to stdout, like reading your crush's texts out loud. By default, all metadata blocks get listed in text format. Wanna narrow it down? Use--block-number,--block-typeor--except-block-typeto switch up the behaviour. β¨--removeβ Yeets one or more metadata blocks out of the metadata. Use--block-number,--block-typeor--except-block-typeto say which blocks are getting the boot. Heads up: if you specify both--block-numberand--[except-]block-type, the result is the logical AND of both arguments β so it's gotta match both to get removed. Unless--dont-use-paddingis specified, the blocks get replaced with padding. And no, you may not remove theSTREAMINFOblock. That one is protected. π--block-number=#[,#[...]]β An optional comma-separated list of block numbers to display. The first block, theSTREAMINFOblock, is block0. Counting starts at zero, always. π’--block-type=type[,type[...]]--except-block-type=type[,type[...]]β An optional comma-separated list of block types to be included or ignored with this option. Use only one of--block-typeor--except-block-typeβ pick a lane, babe. The valid block types are:STREAMINFO,PADDING,APPLICATION,SEEKTABLE,VORBIS_COMMENT,PICTURE. π
You can also narrow down which APPLICATION blocks get selected by appending APPLICATION with a colon and the ID of the APPLICATION block, in either ASCII or hexadecimal representation. E.g. APPLICATION:abcd for the APPLICATION block(s) whose textual representation of the 4-byte ID is "abcd", or APPLICATION:0xXXXXXXXX for the APPLICATION block(s) whose hexadecimal big-endian representation of the 4-byte ID is "0xXXXXXXXX". For the example "abcd" above, the hexadecimal equivalent is 0x61626364. iykyk π§
--application-data-format=hexdump|textβ If the application block you're displaying contains binary data but you've got--data-format=text, you can display a hex dump of the application data contents instead by using--application-data-format=hexdump. Problem solved, bestie. π«Ά--data-format=binary|binary-headerless|textβ For use with--list. By default a human-readable text representation of the data is displayed. You may specify--data-format=binaryto dump the raw binary form of each metadata block. Specify--data-format=binary-headerlessto omit output of metadata block headers β including the id ofAPPLICATIONmetadata blocks. π₯--appendβ Insert a metadata block from a file. This must be a binary block as exported with--list --data-format=binary. The insertion point is defined with--block-number=#, and the new block gets added after the given block number. Why? Because it prevents the illegal insertion of a block before the firstSTREAMINFOblock. Also: you may not--appendanotherSTREAMINFOblock. No cap. π«
Fun fact though β it's possible to copy a metadata block from one file to another with this option. Like, watch:
metaflac --list --data-format=binary --block-number=6 file.flac > block
...to export the block, and then import it with:
metaflac --append anotherfile.flac < block
Iconic behaviour, honestly. π
--remove-allβ Remove all metadata blocks (except theSTREAMINFOblock, obviously, she's not going anywhere) from the metadata. Unless--dont-use-paddingis specified, the blocks will be replaced with padding. Total reset energy. π§Ή--merge-paddingβ Merge adjacentPADDINGblocks into single blocks. Squish them together, they're a family now. π--sort-paddingβ Move allPADDINGblocks to the end of the metadata and merge them into a single block. One big tidy pile at the back, the way it should be. β¨
πΈ SEE ALSO πΈ
flac(1)β her sister, her other half, the whole reason we're here π
And that's a wrap on metaflac(1), bestie β this page was living in Version 1.5.0, and honestly? She ate. Now go fix your FLAC metadata, you gorgeous little command-line gremlin. π¦π
π¦ where this page comes from
- fedora 43: flac 1.5.0-3.fc43 Β· BSD-3-Clause AND GPL-2.0-or-later AND GFDL-1.3-or-later
- fedora 43: flac 1.5.0-5.fc43 Β· BSD-3-Clause AND GPL-2.0-or-later AND GFDL-1.3-or-later
- fedora 44: flac 1.5.0-8.fc44 Β· BSD-3-Clause AND GPL-2.0-or-later AND GFDL-1.3-or-later
- fedora 44: flac 1.5.0-8.fc44 Β· BSD-3-Clause AND GPL-2.0-or-later AND GFDL-1.3-or-later
- nixpkgs unstable: flac 1.5.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms