summaryrefslogtreecommitdiff
path: root/man/metaflac.sgml
blob: a87ea5809632237ac7113c486afb92607196c5ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [

<!-- Process this file with docbook-to-man to generate an nroff manual
     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
     less'.  A typical entry in a Makefile or Makefile.am is:

manpage.1: manpage.sgml
	docbook-to-man $< > $@
  -->

<!-- This is based on an example constructed by Colin Watson
     <email>cjwatson@debian.org</email>, based on a man page template
     provided by Tom Christiansen <email>tchrist@jhereg.perl.com</email>
     and a DocBook man page example by Craig Small
     <email>csmall@debian.org</email>.
  -->

  <!-- Fill in the various UPPER CASE things here. -->
  <!ENTITY manfirstname "<firstname>dann</firstname>">
  <!ENTITY mansurname   "<surname>frazier</surname>">
  <!-- Please adjust the date whenever revising the manpage. -->
  <!ENTITY mandate      "<date>2013/04/30</date>">
  <!-- SECTION should be 1-8, maybe with subsection. Other parameters are
       allowed: see man(7), man(1). -->
  <!ENTITY mansection   "<manvolnum>1</manvolnum>">
  <!ENTITY manemail     "<email>dannf@debian.org</email>">
  <!ENTITY manusername  "dannf">
  <!ENTITY manucpackage "<refentrytitle>METAFLAC</refentrytitle>">
  <!ENTITY manpackage   "metaflac">
]>

<refentry>
  <refentryinfo>
    <address>
      &manemail;
    </address>
    <author>
      &manfirstname;
      &mansurname;
    </author>
    <copyright>
      <year>2002-2005, 2011-2013</year>
      <holder>&manusername;</holder>
    </copyright>
    &mandate;
  </refentryinfo>
  <refmeta>
    &manucpackage;

    &mansection;
  </refmeta>
  <refnamediv>
    <refname>&manpackage;</refname>

    <refpurpose>
      program to list, add, remove, or edit metadata in one or more FLAC files.
    </refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&manpackage;</command>

      <group choice="opt"><arg><replaceable>options</replaceable></arg></group>
      <group choice="opt">
	<arg><replaceable>operations</replaceable></arg></group>
      <arg rep="repeat" choice="req"><replaceable>FLACfile</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para>Use <command>&manpackage;</command> 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.</para>

  </refsect1>
  <refsect1>
    <title>OPTIONS</title>

    <variablelist>
      <varlistentry>
        <term><option>--preserve-modtime</option></term>
        <listitem>
          <para>
	    Preserve the original modification time in spite of edits.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--with-filename</option></term>
        <listitem>
          <para>
	    Prefix each output line with the FLAC file name (the default if
	    more than one FLAC file is specified).
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--no-filename</option></term>
        <listitem>
          <para>
	    Do not prefix each output line with the FLAC file name (the default
	    if only one FLAC file is specified).
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--no-utf8-convert</option></term>
        <listitem>
          <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--dont-use-padding</option></term>
        <listitem>
          <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>SHORTHAND OPERATIONS</title>

    <variablelist>
      <varlistentry>
        <term><option>--show-md5sum</option></term>
        <listitem>
          <para>
	    Show the MD5 signature from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-min-blocksize</option></term>
        <listitem>
          <para>
	    Show the minimum block size from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-max-blocksize</option></term>
        <listitem>
          <para>
	    Show the maximum block size from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-min-framesize</option></term>
        <listitem>
          <para>
	    Show the minimum frame size from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-max-framesize</option></term>
        <listitem>
          <para>
	    Show the maximum frame size from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-sample-rate</option></term>
        <listitem>
          <para>
	    Show the sample rate from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-channels</option></term>
        <listitem>
          <para>
	    Show the number of channels from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-bps</option></term>
        <listitem>
          <para>
	    Show the # of bits per sample from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-total-samples</option></term>
        <listitem>
          <para>
	    Show the total # of samples from the STREAMINFO block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-vendor-tag</option></term>
        <listitem>
          <para>
	    Show the vendor string from the VORBIS_COMMENT block.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--show-tag=name</option></term>
        <listitem>
          <para>
	    Show all tags where the field name matches 'name'.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--remove-tag=name</option></term>
        <listitem>
          <para>
	    Remove all tags whose field name is 'name'.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--remove-first-tag=name</option></term>
        <listitem>
          <para>
	    Remove first tag whose field name is 'name'.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--remove-all-tags</option></term>
        <listitem>
          <para>
	    Remove all tags, leaving only the vendor string.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--set-tag=field</option></term>
        <listitem>
          <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--set-tag-from-file=field</option></term>
        <listitem>
          <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--import-tags-from=file</option></term>
        <listitem>
	  <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--export-tags-to=file</option></term>
        <listitem>
	  <para>
	    Export tags to a file.  Use '-' for stdout.  Each
	    line will be of the form NAME=VALUE.  Specify
	    --no-utf8-convert if necessary.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--import-cuesheet-from=file</option></term>
        <listitem>
	  <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--export-cuesheet-to=file</option></term>
        <listitem>
	  <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--import-picture-from</option>={<replaceable>FILENAME</replaceable>|<replaceable>SPECIFICATION</replaceable>}</term>
	<listitem>
	  <para>Import a picture and store it in a PICTURE metadata block.  More than one --import-picture-from command can be specified.  Either a filename for the picture file or a more complete specification form can be used.  The SPECIFICATION is a string whose parts are separated by | (pipe) characters.  Some parts may be left empty to invoke default values.  FILENAME is just shorthand for "||||FILENAME".  The format of SPECIFICATION is</para>
	  <para>[TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE</para>
	  <para>TYPE is optional; it is a number from one of:</para>
	  <para>0: Other</para>
	  <para>1: 32x32 pixels 'file icon' (PNG only)</para>
	  <para>2: Other file icon</para>
	  <para>3: Cover (front)</para>
	  <para>4: Cover (back)</para>
	  <para>5: Leaflet page</para>
	  <para>6: Media (e.g. label side of CD)</para>
	  <para>7: Lead artist/lead performer/soloist</para>
	  <para>8: Artist/performer</para>
	  <para>9: Conductor</para>
	  <para>10: Band/Orchestra</para>
	  <para>11: Composer</para>
	  <para>12: Lyricist/text writer</para>
	  <para>13: Recording Location</para>
	  <para>14: During recording</para>
	  <para>15: During performance</para>
	  <para>16: Movie/video screen capture</para>
	  <para>17: A bright coloured fish</para>
	  <para>18: Illustration</para>
	  <para>19: Band/artist logotype</para>
	  <para>20: Publisher/Studio logotype</para>
	  <para>The default is 3 (front cover).  There may only be one picture each of type 1 and 2 in a file.</para>

	  <para>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 --&gt; to mean that FILE is actually a URL to an image, though this use is discouraged.</para>

	  <para>DESCRIPTION is optional; the default is an empty string.</para>

	  <para>The next part specfies 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.</para>

	  <para>FILE is the path to the picture file to be imported, or the URL if MIME type is --&gt;</para>

	  <para>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.</para>

	  <para>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.</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--export-picture-to=file</option></term>
        <listitem>
	  <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--add-replay-gain</option></term>
        <listitem>
	  <para>
	    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, 18.9, 22.05, 24, 28, 32, 37.8, 44.1, 48, 56, 64, 88.2,
	    96, 112, 128, 144, 176.4, or 192kHz.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--scan-replay-gain</option></term>
        <listitem>
	  <para>
            
	    Like --add-replay-gain, but only analyzes the files rather
	    than writing them to the tags.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--remove-replay-gain</option></term>
        <listitem>
	  <para>
	    Removes the ReplayGain tags.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--add-seekpoint</option>={<replaceable>#</replaceable>|<replaceable>X</replaceable>|<replaceable>#x</replaceable>|<replaceable>#s</replaceable>}</term>
	<listitem>
	  <para>
	    Add seek points to a SEEKTABLE block.  Using #, a seek point at
	    that sample number is added.  Using X, 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 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.  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.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--add-padding=length</option></term>
        <listitem>
          <para>
	    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.
	  </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>MAJOR OPERATIONS</title>

    <variablelist>
      <varlistentry>
        <term><option>--list</option></term>
        <listitem>
          <para>
	    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:
	  </para>
	  <variablelist>
	    <varlistentry>
	      <term><option>--block-number=#[,#[...]]</option></term>
	      <listitem>
		<para>
		  An optional comma-separated list of block numbers to display.
		  The first block, the STREAMINFO block, is block 0.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term><option>--block-type=type[,type[...]]</option></term>
	      <listitem><para></para></listitem>
	    </varlistentry>
	    <varlistentry>
	      <term><option>--except-block-type=type[,type[...]]</option></term>
	      <listitem>
		<para>
		  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, PICTURE.  You
		  may narrow down the types of APPLICATION blocks displayed as
		  follows:
		</para>
		<para>
        APPLICATION:abcd        The APPLICATION block(s) whose textual repre-
                                sentation of the 4-byte ID is "abcd"
        APPLICATION:0xXXXXXXXX  The 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
		</para>
		<note>
		  <para>
		    if both --block-number and --[except-]block-type are
		    specified, the result is the logical AND of both
		    arguments.</para></note>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term><option>--application-data-format=hexdump|text</option></term>
	      <listitem>
		<para>
		  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.
		</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--remove</option></term>
        <listitem>
          <para>
            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.
	  </para>
	  <variablelist>
	    <varlistentry>
	      <term><option>--block-number=#[,#[...]]</option></term>
	      <listitem><para></para></listitem>
	    </varlistentry>
	    <varlistentry>
	      <term><option>--block-type=type[,type[...]]</option></term>
	      <listitem><para></para></listitem>
	    </varlistentry>
	    <varlistentry>
	      <term><option>--except-block-type=type[,type[...]]</option></term>
	      <listitem>
		<para>See --list above for usage.</para>
		<note>
		  <para>
		    if both --block-number and --[except-]block-type are
		    specified, the result is the logical AND of both arguments.
		  </para></note>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--remove-all</option></term>
        <listitem>
          <para>
            Remove all metadata blocks (except the STREAMINFO block) from the
            metadata.  Unless --dont-use-padding is specified, the blocks will
            be replaced with padding.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--merge-padding</option></term>
        <listitem>
          <para>
	    Merge adjacent PADDING blocks into single blocks.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--sort-padding</option></term>
        <listitem>
          <para>
	    Move all PADDING blocks to the end of the metadata and merge them
            into a single block.
	  </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>

    <para>flac(1).</para>
  </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->