-
Notifications
You must be signed in to change notification settings - Fork 7
/
id3.man
411 lines (393 loc) · 13.9 KB
/
id3.man
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
.TH ID3 1 "id3 mass tagger"
.SH NAME
id3 \- a command line mass tagger
.SH SYNOPSIS
.HP 2
.B id3
.RB [ \-v ]
.RB [ \-m ]
.RB [ \-123 ]
.RB [ \-d ]
.RB [ \-t
.IR title ]
.RB [ \-a
.IR artist ]
.RB [ \-l
.IR album ]
.br
.RB [ \-n
.IR tracknr ]
.RB [ \-y
.IR year ]
.RB [ \-g
.IR genre ]
.RB [ \-c
.IR comment ]
.br
.RB [ \-f
.IR template ]
.RB [ \-q
.IR format ]
.RB [ \-D
.IR file ]
.RB [ \-R ]
.RB [ \-M ]
.br
.RB [ \-E ]
.RB [ \-s
.IR size ]
.RB [ \-u ]
.RB [ \-r\fIFRAME ]
.RB [ \-w\fIFRAME
.IR data ]
.IR \*(lqfilespec\*(rq
.SH DESCRIPTION
.I id3
mass tagger is a tool for listing and manipulating ID3 and Lyrics3
tags in multiple
files. It can generate tag fields from the filename and other variables,
and/or rename files, using an intuitive syntax.
.I id3
currently supports old-style ID3v1 tags, Lyrics3v2, as well as the more complex ID3v2 format.
This means its use is limited to audio files which use these
formats, i.e. MPEG-1 Layer III.
.SH OPTIONS
Order of the options is only important where specified.
.TP
.B filespec ...
specifies the file(s) to be affected by the command.
When using wildcards, enclose the specification
in quotes in order for pattern matching to work; see
.B SUBSTITUTION
below.
.TP
.BR \-h ", " \-\-help
show command line help
.TP
.BR \-V ", " \-\-version
display version number and copyright
.TP
.BR \-v ", " \-\-verbose
be verbose
.TP
.B \-1
process/add ID3v1 tags.
.TP
.B \-2
process/add ID3v2 tags.
.TP
.B \-3
process/add Lyrics3 tags.
If more than one tag type is specified, they are all written, and the left-most
one that is found is used for variable substitution. If no tag type is specified,
.I id3
will by default
attempt to read ID3v2, Lyrics3 and ID3v1 tags in that order, only modify existing ID3v2 and Lyrics3 tags, and modify/add ID3v1 tags.
.TP
.BR \-R ", " \-\-recursive
searches recursively; When this is enabled, `*' wildcards in \fIfilespec\fR will also match against
directory separators. Normally, this is not the case.
.TP
.BR \-M ", " \-\-keep\-time
preserve last modification time of files operated on
.TP
.BR \-X ", " \-\-no-glob
disable internal globbing; as a consequence, the pattern matching functionality will not be available.
Use this switch to force
the treatment of \fIfilespec\fR arguments as simple filenames, which might be useful if
.I id3
is being called by shell scripts or other programs
.TP
.B \-\-
force the following argument to be interpreted as a filename. Use this for
files that start with a `-' (dash).
.P
.SS Modifying operations
The default operation of
.I id3
is to list the tags found. By using any of the following options, this behaviour is inhibited.
.TP
.BR \-d ", " \-\-delete
do not re-use existing tag data. If no new tag information is specified in
conjunction with this option, all selected tags will be removed.
.PP
.ta 1.2i 2.4i
.BR "\-t \fItitle\fP" ",\t\t" "\-\-title \fItitle\fP"
.br
.BR "\-a \fIartist\fP" ",\t\t" "\-\-artist \fIartist\fP"
.br
.BR "\-l \fIalbum\fP" ",\t" "\-A \fIalbum\fP" ",\t" "\-\-album \fIalbum\fP"
.br
.BR "\-n \fItracknr\fP" ",\t" "\-T \fItracknr\fP" ",\t" "\-\-track \fItracknr\fP"
.br
.BR "\-y \fIyear\fP" ",\t\t" "\-\-year \fIyear\fP"
.br
.BR "\-g \fIgenre\fP" ",\t\t" "\-\-genre \fIgenre\fP"
.br
.BR "\-c \fIcomment\fP" ",\t\t" "\-\-comment \fIcomment\fP"
.IP
add/replace the specified fields in all selected tags with the values
given. Field values are scanned for substitution variables, see
.B SUBSTITUTION
below. If a field value is a single variable, and its substitution fails, no
operation is performed.
Genres can be specified either verbatim or by using their assigned number,
regardless of tag format.
.TP
.BR "\-f \fIfilename-template\fP" ", " "\-\-rename \fIfilename-template\fP"
rename files encountered according to \fIfilename-template\fR.
The argument is scanned for substitution variables. An empty variable will by
default get replaced with \*(lqUnknown\*(rq.
Trying to rename to an already existing file will cause an error.
.TP
.BR "\-q \fIformat\fP" ", " "\-\-query \fIformat\fP"
for each file encountered, \fIformat\fR will get scanned for substitution
variables, and written to standard output. Using this option will block any
attempt to modify files.
.TP
.BR \-m ", " \-\-match
match mode; interpret any substitution variables (see
.B SUBSTITUTION
below) found in a \fIfilespec\fR as a wildcard,
and set the corresponding tag field to the matched portion of the filename.
Thus, `id3 -m\ "%a\ -\ %t.mp3"' is short-hand for `id3 -a\ %1\ -t\ %2\ "*\ -\ *.mp3"'.
.TP
.BR "\-D \fIfilename\fP" ", " "\-\-duplicate \fIfilename\fP"
duplicate and copy the tags found in \fIfilename\fR
to the target files. The tag in each target file is replaced after any variables have
been read, but before any fields are updated.
Any original tag values not explicitly written to the new tag (for example, by
using -u) are lost. If \fIfilename\fR does not have any tags, this option is
identical to the -d option.
.TP
.BR \-L ", " \-\-list-genres
produces a list of genres usable in ID3v1 tags, and their assigned numbers
.PP
The following options only apply on the tag most recently selected before
them, and only have meaning where relevant.
.TP
.BR \-E ", " \-\-if\-exists
only write a tag of the most recently selected type if a file already contains it; do not add new ones.
.TP
.BR \-u ", " \-\-update
update all standard tag fields by copying them from the source tag. This is
similar to writing `-talnygc %t %a %l %n %y %g %c', but only operates on the
most recent tag. It is possible for the source and destination tag to be the
same.
.TP
.BR "\-s \fIsize\fP" ", " "\-\-size \fIsize\fP"
try to write a new tag using exactly \fIsize\fR bytes, adding / removing
padding as necessary. The resulting tag will have no padding if \fIsize\fR
is smaller than the actual size necessary.
.TP
.BR "\-r\fIFRAME\fP" ", " "\-\-remove=\fIFRAME\fP"
remove occurrences of frames named \fIFRAME\fR from the tag. Consult the
format documentation for valid \fIFRAME\fR names.
For text frames, it is equivalent to `-w\fIFRAME\fP ""'.
.TP
.BR "\-w\fIFRAME data\fP" ", " "\-\-frame=\fIFRAME data\fP"
add / update a frame named \fIFRAME\fR with \fIdata\fR in the tag.
\fIdata\fR is scanned for substitution variables. Again, consult the format
documentation. See \fBCOMPATIBILITY\fP for more information.
.PP
Short-form options can be stacked in a single argument for more convenience.
For example, running
id3 -2d -alt "Artist" "Album" "Title" *.mp3
is equivalent to:
id3 -2 -d -a "Artist" -l "Album" -t "Title" *.mp3
.SH SUBSTITUTION
.I id3
can perform \*(lqprintf-like\*(rq substitution on the values prior to
writing them to a tag. Note that if you want to use pattern matching, you
HAVE TO enclose the wildcard specification on the command line in quotes
to prevent your shell from expanding any wildcards.
.TP
.BI \(rs c
escape sequence. \(rsn, \(rsr, \(rst, \(rsv, \(rsf, \(rsb, \(rsa, get replaced as in C, any
other character will be stripped of any special meaning. E.g., \(rsn becomes the
newline character, \(rs\(rs a single backslash.
.TP
.BI % <modifiers>N
.SM where \fIN\fR <- [0..9]
.br
replaced with the portion of the file path matching the \fIn\fRth `*'
(asterisk) wildcard in the file specification. 0 is taken to mean 10.
.TP
.BI % <modifiers>c
.SM where \fIc\fR <- [a..z]
.RS
replaced by values according to the following table:
.PP
.BR %t " title
.br
.BR %a " artist
.br
.BR %l " album\ title
.br
.BR %n " track\ number
.br
.BR %y " year
.br
.BR %g " genre
.br
.BR %c " comment\ field
.br
.BR %f " file\ name\ (without\ path)
.br
.BR %p " path\ to\ filename
.br
.BR %x " auto-increasing\ counter
.br
.BR %X " file counter
.PP
Values get read (where applicable) from the source tag, which is the left-most
tag selected on the command line, and reflect the state of the file before any
modifications were made. If the source value is not available, the variable
fails.
\*(lq%_p%_f\*(rq combines to the raw full path and file name. The \*(lq%x\*(rq value
gets increased every time it has been substituted inside the same directory,
and is intended for auto-numbering. \*(lq%X\*(rq increases for every file
processed.
.RE
.TP
.BI % <modifiers> { FRAME }
replaced by the content of the \fIFRAME\fP frame in the selected source tag; any
frame writeable with the \fB-w\fP option can be used; see \fBCOMPATIBILITY\fP for more information.
.TP
.B %%
replaced with a single \*(lq%\*(rq, equivalent to \fB\(rs%\fR
.TP
.BI %| text || alt\ text || ... |?
substituted by the first \fItext\fR that was completely successful, or fails
as empty, see \fBfall-backs\fR below. This can be used as an all-or-nothing
substitution. A lone \*(lq%?\*(rq always fails.
.SS Available \fI<modifiers>\fR (optional):
.TP
.BR + " (plus\ sign)
Capitalize the substituted value
.TP
.BR - " (minus\ sign)
Convert all characters to lowercase
.TP
.BR _ " (underscore)
Use the raw value of the variable. Normally, substitution replaces any
underscores with spaces, and condenses empty whitespace.
.TP
.BR * " (asterisk)
Split the variable into separate words by looking at the capitalization.
.TP
.BR # " (hash\ or\ pound\ sign)
Attempt to fit numeric values in the substituted string to a desired width,
by removing or adding leading zeros.
Multiple hash signs can be stacked to indicate the desired width. If there are
no numeric values, this modifier has no effect.
.TP
.BI | fall-back |
If substitution for a variable fails, attempt \fIfall-back\fR instead.
\fIfall-back\fR itself may be empty or contain other variables (including other
fall-backs). If \fIfall-back\fR contains variables that fail, the \fIfall-back\fR
fails and will not be used. If more than one fall-back is provided, successive
fall-backs are tried until one succeeds.
.RE
.SH EXAMPLES
Here are some examples of using
.I id3
:
.TP
\fBid3 -a "Stallman" -t "Free Software Song" fs_song.mp3"
Add a simple tag to a file.
.TP
\fBid3 muzak.mp3
List tag information in a file.
.TP
\fBid3 -d *.mp3
Removes all ID3v1 tags from all mp3's.
.TP
\fBid3 -2 -1u fs_song.mp3
Copy ID3v2 tag to ID3v1 tag in selected file.
.TP
\fBid3 -D source.mp3 -1 -2 dest.mp3
Duplicate ID3v1 and ID3v2 tags of source.mp3
.TP
\fBid3 -a "TAFKAT" -n "%1" -t "%+2" "*. *.mp3"
Update tag fields similar to this;
.nf
-a "TAFKAT" -n "01" -t "My Song" "01. my_song.mp3"
-a "TAFKAT" -n "02" -t "Untitled" "02. untitled.mp3"
.TP
\fBid3 -2 -f "%a - %t.mp3" blaet.mp3
Rename file to a standard format, using ID3v2 values.
.TP
\fBid3 -a %t -t %a "*.mp3"
Swap artist and title fields in all mp3's.
.TP
\fBid3 -2 -rAPIC -s 0 *.mp3
Removes embedded images and padding from all mp3's.
.TP
\fBid3 -2d -u *.mp3
Rewrite ID3v2 tag while keeping only the basic fields.
.TP
\fBid3 -2 -wUSLT "foo, bar\nlalala!\n" blaet.mp3
Adds an ID3v2 lyric frame to blaet.mp3.
.TP
\fBid3 -v -g alt-rock -alnt "The Author" %1 %2 %3 "Author - */(*) *.mp3"
Process multiple directories at once.
.TP
\fBid3 -v -g alt-rock -a "The Author" -m "Author - %l/(%n) %t.mp3"
Shorthand for the previous example.
.TP
\fBid3 -2 -c "Was: %_f" -f "%|Nobody|a - %|Untitled (%x)|t.mp3" "*.mp3"
Rename with missing values replaced. Saves previous filename in the comments.
.TP
\fBid3 -2 -q "%|%{TPE2}||%{TXXX:ALBUM ARTIST}|?"
Tries to print the \*(lqalbum artist\*(rq using two possible ID3v2 frames.
.TP
\fBid3 -2 -q "%| %a - %|Untitled|t || %t || %1 |?" "*.mp3"
Generate a simple list of songs.
.SH NOTES
The internal pattern matching emulates the normal pattern matching of
\*(lqsh\*(rq. It supports ?, * and [].
A shell pattern will never match a forward slash (\*(lq/\*(rq) or a dot
(\*(lq.\*(rq) beginning a filename. Wildcards can be used for directories as
well (to arbitrary depths), in which case a search will be performed.
In an ambiguous situation, the pattern matcher will always resolve a
\*(lq*\*(rq wildcard to the shortest possible sequence of tokens. This differs
from the behavior of regular expressions, however it tends to make sense in
the context of filenames.
Do NOT add ID3 tags to files for which it does not make sense, i.e, add them
only to MP3 files. In particular, do not add ID3v2 tags to Ogg files, since
ID3v2 tags start at the beginning of the file.
.SH COMPATIBILITY
id3 has a built-in genre list of 192 genres. If you pass the \fB-g\fP parameter a
string instead of a number when using ID3v1, id3 tries to find the specified
genre in this list, and selects the closest possible match (if any). For the
genre numbers and exact spelling, use the \fB--list-genres\fR option.
An empty or invalid genre is assigned the number 0.
The ID3v1 format only supports to the ISO-8859-1 (Latin 1) encoding. If you
need other Unicode characters, you need to use ID3v2 tags.
When using \fB-2\fP, id3 will write ID3v2.3 by default, unless a file is already
tagged with the older ID3v2.2. id3 can read ID3v2.4 tags, but
these will be converted to ID3v2.3 when modified.
Furthermore, with ID3v2 tags, the \fB-w\fIFRAME\fR option and %{\fIFRAME\fR} substitution only support the following ID3v2.2 (3 letter)/ID3v2.3 (4 letter) frames:
T??/T??? (text),
W??/W??? (links),
COM/COMM (comment),
IPL/IPLS (involved people),
ULT/USLT (lyrics),
CNT/PCNT (numeric play counter),
POP/POPM (popularimeter) and
USER (tos, v2.3 only).
Attempts to write ID3v2.2 frames to ID3v2.3 or vice versa will be ignored.
Several ID3v2 frames can be specialized with additional descriptors (TXXX, WXXX, COMM, USLT). These can be read or written using
the extended syntax \fB-w\fIFRAME\fR:\fIdescriptor\fR and %{\fIFRAME\fR:\fIdescriptor\fR}.
Descriptors are case sensitive and may contain whitespace.
For frames that are language-specific (COMM, USLT), the form \fIFRAME\fR:\fIdescriptor\fR:\fIxxx\fR may also be used, where \fIxxx\fR is a three letter ISO-639-2 language code.
Which \fIdescriptors\fR are meaningful is application-specific.
id3 does not support unnecessary ID3v2 features such as compression, encryption, or embedding binary data (including image files).
.SH AUTHOR
Written by Marc R. Schoolderman <[email protected]>.
.SH COPYRIGHT
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH SEE ALSO
Program homepage: \fIhttps://squell.github.io/id3\fR