File: mp3info.1

package info (click to toggle)
mp3info 0.8.4-9.2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 288 kB
  • ctags: 166
  • sloc: ansic: 1,441; makefile: 86; sh: 10
file content (436 lines) | stat: -rw-r--r-- 13,606 bytes parent folder | download | duplicates (2)
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
.TH mp3info 1 "July 16, 2001" "mp3info"

.SH NAME
mp3info \- MP3 technical info viewer and ID3 tag editor

.SH SYNOPSIS
.B mp3info \fP[\fB -h \fP|\fB -G \fP]\fB
.PP
.B mp3info \fP[\fB-x\fP] [\fB-F\fP] [\fB-r a\fP|\fBm\fP|\fBv\fP] [\fB-p\fP \fIFORMAT_STRING\fP] \fIfile...\fR
.PP
.B mp3info \fP[\fB-d\fP]\fB \fIfile...\fP
.PP
.B mp3info \fP[\fB-i\fP] [\fB-t \fItitle\fP] [\fB-a \fIartist\fP] [\fB-l \fIalbum\fP] [\fB-y \fIyear\fP] [\fB-c \fIcomment\fP] [\fB-n \fItrack\fP] [\fB-g \fIgenre\fP] \fIfile...\fP
.br

.SH DESCRIPTION
.B mp3info
is a utility used to read and modify the ID3 tags in MPEG 
layer 3 (MP3) files.  It can also (optionally) display various technical
attributes of the MP3 file. 

.SH OPTIONS
.B
.IP "-a \fIartist\fP"
Specify ID3 artist name
.B
.IP "-c \fIcomment\fP"
Specify ID3 comment
.B
.IP "-g \fIgenre\fP"
Specify ID3 genre (use \fB-G\fP option for a list of valid genres).
You may specify either a genre name or a number.
.B
.IP "-l \fIalbum\fP"
Specify ID3 album name
.B
.IP "-n \fItrack\fP"
Specify ID3 v1.1 track number
.B
.IP "-t \fItitle\fP"
Specify ID3 track title
.B
.IP "-y \fIyear\fP"
Specify ID3 copyright year
.B
.IP -G
Display a list of valid genres and their associated numeric codes. These are the only
values accepted by the \fB-g\fP switch.
.B
.IP -h 
Display a help page
.B
.IP -x
Display technical attributes of the MP3 file
.B
.IP "-r a\fP|\fBm\fP|\fBv"
Report bit rate of Variable Bit Rate (VBR) files as one of the following
(See the section below entitled \fBBit Rates\fP for more information):
.PP
.RS 7
.PD 0
.HP
.B a
\- Average bit rate [float](Note: this option also causes the bit rates of
non-VBR files to be displayed as floating point values).
.LP
.HP
.B m
\- Median bit rate [integer]
.LP
.HP
.B v
\- Simply use the word 'Variable' [string] (this is the default).
.PD
.RE
.B
.IP -i
Edit ID3 tag interactively (uses curses/ncurses functions)
.B
.IP -d
Delete ID3 tag (if one exists)
.B
.IP -f
Force Mode: Treat all files as MP3s even if MP3 frames can't be found
.B
.IP -F
Do a Full scan for technical information (see the section \fBSpeed Considerations\fP below for more information)
.PP
.B
-p "\fIFORMAT_STRING\fP"
.IP 
Print MP3 attributes according to \fIFORMAT_STRING\fP.  \fIFORMAT_STRING\fP is 
similar to a \fBprintf(3)\fP format string in that it is printed verbatim except 
for the following conversions and escape sequences. Any conversion specifier may 
optionally include the various alignment, precision, and field width modifiers 
accepted by \fBprintf(3)\fP.  See
the \fBEXAMPLES\fP section below for examples of how format strings are used
in mp3info.
.PP
.IP
.B Conversion Specifiers
.PP
.RS 10
.PD 0
.B
.IP %f
Filename without the path [string]
.B
.IP %F
Filename with the path [string]
.B
.IP %k
File size in KB [integer]
.B
.IP %a
Artist [string]
.B
.IP %c
Comment [string]
.B
.IP %g
Musical genre [string]
.B
.IP %G
Musical genre number [integer]
.B
.IP %l
Album name [string]
.B
.IP %n
Track [integer]
.B
.IP %t
Track Title [string]
.B
.IP %y
Year [string]
.B
.IP %C
Copyright flag [string]
.B
.IP %e
Emphasis [string]
.B
.IP %E
CRC Error protection [string]
.B
.IP %L
MPEG Layer [string]
.B
.IP %O
Original material flag [string]
.B
.IP %o
Stereo/mono mode [string]
.B
.IP %p
Padding [string]
.B
.IP %v
MPEG Version [float]
.B
.IP %u
Number of good audio frames [integer]
.B
.IP %b
Number of corrupt audio frames [integer]
.B
.IP %Q
Sampling frequency in Hz [integer]
.B
.IP %q
Sampling frequency in kHz [integer]
.B
.IP %r
Bit Rate in kbps (type and meaning affected by \fB-r\fP option)
.B
.IP %m
Playing time: minutes only [integer]
.B
.IP %s
Playing time: seconds only [integer] (usually used in conjunction with \fB%m\fP)
.B
.IP %S
Total playing time in seconds [integer] 
.B
.IP %%
A single percent sign
.RE
.PD
.PP
.RS 7
.B "Escape Sequences"
.RE
.PP
.PD 0
.RS 10
.B
.IP \en
Newline
.B
.IP \et
Horizontal tab
.B
.IP \ev
Vertical tab
.B
.IP \eb
Backspace
.B
.IP \er
Carriage Return
.B
.IP \ef
Form Feed
.B
.IP \ea
Audible Alert (terminal bell)
.B
.IP \ex\fIhh\fB
Any arbitrary character specified by the hexidecimal number \fIhh\fP
.B
.IP \e\fIooo\fB
Any arbitrary character specified by the octal number \fIooo\fP
.B
.IP \fB\e\e\fP
A single backslash character
.RE
.PP
.PD


.SH USAGE

Specifying MP3 files without any other options displays the existing ID3 tag (if any).
.PP
Specifying a track number of 0 reverts an ID3 tag to 1.0 format
.PP
Non-specified ID3 fields, if existant, will remain unchanged.
.PP
Genres can be specified as numbers or names: \fB-g 17\fP same as \fB-g Rock\fP
.PP
Multiple word fields must be enclosed in quotes (eg: \fB-t "A title"\fP)

.SH NOTES

.IP "\fBSpeed Considerations\fP"
In order to determine certain technical attributes (playing time, number of 
frames, number of bad frames, and in a few cases the bit rate) with absolute 
certainty, it would be necessary to read the entire MP3 file.  Mp3info normally 
tries to speed things up by reading a handful of frames from various points in 
the file and estimating the statistics for the rest of the file based on those 
samples.  Usually, this results in very accurate estimates.  Audio playing times 
are usually off by no more than a second, and the number of frames is off by 
less than 0.1%.  Often the estimates agree exactly with the full scans. 
Nevertheless, the user may wish to ensure that she is getting exact information.  
.IP
One should specify the \fB-F\fP switch if one wants mp3info to read the entire 
MP3 file when determining this information.  Note that a full scan will only 
affect mp3info's output if the \fB-x\fP switch is used or the \fB-p\fP switch is 
used with a FORMAT_SPECIFIER containing \fB%m\fP, \fB%s\fP, \fB%S\fP, \fB%u\fP 
or (rarely) \fB%r\fP.  Using the \fB-F\fP switch under other conditions will 
only slow down mp3info.  Also note that a FORMAT_SPECIFIER containing \fB%b\fP 
or a VBR MP3 file will automatically trigger a full scan even if the \fB-F\fP 
switch is not used.

.IP "\fBBit Rates\fP"
MP3 files are made up of many (usally several thousand) audio blocks called 'frames'.
Each of these frames is encoded at a specific 'bit rate' which 
determines both the quality of the sound and the size of the frame itself.  Bit 
rates can range from 8 Kb/s (kilobits per second) to 320 Kb/s.  Note that the 
MP3 specification only allows 14 discreet bit rates for an MP3 file, so, for 
instance, a stereo MP3 could have frames with bit rates of 128 Kb/s and 160 
Kb/s, but nowhere in between.
.IP
Audio frames with high bit rates sound much better than those with lower bit 
rates, but take up more space.  Obviously, one would like to use a bit rate that 
is only high enough to maintain a comfortable level of audio quality.  Normally, 
all the frames in an MP3 file are encoded at the same bit rate.  A few MP3 
files, however, are encoded such that the bit rate may vary from one frame to 
the next.  These MP3 files are called Variable Bit Rate (or VBR) files.   Since  
VBR files do not have one single bit rate, attempting to report the bit rate of 
the file as a whole can be problematic.  Consequently, 
mp3info allows you to specify how you want this value reported.
.IP
The default is to simply print the word 'Variable' where the bit rate would 
normally appear.  Another option is to print the mathematical average of all 
the frames.  This has the advantage of being completely accurate, but the number 
printed may not correspond to one of the 14 discreet bit rates that would be 
allowed for that file.  The third alternative solves that problem by allowing 
the bit rate to be reported as the median bit rate which is what you would get 
if you lined up all the frames in the file by bit rate from lowest to highest 
and picked the 
frame closest to the middle of the line.
.IP
For more specific usage information, see the \fB-r\fP switch and the \fB%r\fP 
conversion specifier under the description of
\fB-p\fP's FORMAT_SPECIFIER.


.SH EXAMPLES

Display existing ID3 tag information (if any) in song.mp3
.PP
.IP
.B
mp3info song.mp3
.PP
Set the title, author and genre of song.mp3. (All other fields unchanged)
.IP
.B
mp3info -t "Song Title" -a Author -g "Rock & Roll" song.mp3
.PP
Set the album field of all MP3 files in the current directory 
to "The White Album"
.PP
.IP
.B
mp3info -l "The White Album" *.mp3
.PP
Delete the entire ID3 tag from song1.mp3 and song2.mp3
.IP
.B
mp3info -d song1.mp3 song2.mp3
.PP
Delete the comment field from the ID3 tags of all MP3 files
in the current directory. (All other fields unchanged)
.IP
.B
mp3info -c "" *.mp3
.PP
Display the Title, Artist, Album, and Year of all MP3 files in the current directory.
We include the labels 'File', etc. and insert newlines (\fB\en\fP) to make things
more readable for humans:
.IP
.B
mp3info -p "File: %f\enTitle: %t\enArtist: %a\enAlbum: %l\enYear: %y\en\en" *.mp3
.PP
Say you want to build a spreadsheet of your MP3 files.  Here's a command you might use
to help you accomplish that.  Most spreadsheet programs will import an ASCII file and treat
a given character as a field separator.  A commonly used field separator is the tab character.
For each MP3 file in the current directory, we want to output the filename, title, artist, 
and album on a single line and have the fields separated by a tab (\fB\et\fP) character.  Note
that you must include a newline (\fB\en\fP) at the end of the format string in order
to get each file's information on a separate line.  Here's the command:
.IP
.B
mp3info -p "%f\et%t\et%a\et%l\et%y\en" *.mp3
.PP
Some spreadsheets or other software may allow importing data from flat files
where each field is a specific width.  Here's where the format modifers come into
play.  This next command outputs the same information as the command above, but uses
fixed-width fields instead of tab separators.  The filename field is defined as
50 characters wide, the title field is defined as 31 characters wide, and so on.
.IP
.B
mp3info -p "%50f%31t%31a%31l%4y\en" *.mp3
.PP
The problem with the output of this command is that all strings are normally right-
justified within their fields.  This looks a little odd since most western
languages read from left to right.  In order to make
the fields left-justified, add a minus sign (\fB-\fP) in front of the field-width:
.IP
.B
mp3info -p "%-50f%-31t%-31a%-31l%-4y\en" *.mp3
.PP
Now suppose you just want the running time of each MP3 file specified in minutes
and seconds.  Simple enough:
.IP
.B
mp3info -p "%f: %m:%s\en" *.mp3
.PP
You may notice when you do this, however, that leading zeros are not displayed
in the seconds field (\fB%s\fP).  So for instance, if you had a
track four minutes and two seconds long its running time would be displayed 
as '4:2' instead of '4:02'.  In order to tell mp3info to pad an integer field
with zeros, you need to use a field width modifier and place a zero in front of it.
The following command is the same as the previous one, but it specifies that mp3info
is to display the seconds field with a fixed
field-width of two characters and to pad the field with leading zeros if necessary:
.IP
.B
mp3info -p "%f: %m:%02s\en" *.mp3
.PP
The last trick we have to show you is the precision specifier for floating point
variables.  The following command displays the filename and average bit rate for
all MP3 files in the current directory.  
.IP
.B
mp3info -r a -p "%f %r\en" *.mp3
.PP
By default, the floating point value of the average bit rate is displayed with six
digits past the decimal point (ex: 175.654332).  If you are like me, this seems like a bit
of overkill.  At most you want one or two digits beyond the decimal place displayed.  Or you
might not want any.  The following command displays the average bit rate with first two, then
zero digits beyond the decimal point:
.IP
.B
mp3info -r a -p "%f %.2r %.0r\en" *.mp3
.PP
If you wanted to specify a field width for a floating point value, you could do that by
placing the field-width before the decimal point in the field modifier.  This command does
just that -- specifying an average bit-rate field six characters wide that will show two
digits of precision beyond the decimal point:
.IP
.B
mp3info -r a -p "%f %6.2r\en" *.mp3
.SH BUGS
There's no "save and quit" in interactive mode. You must fill in all the 
fields (even if it is with blanks) and let the program finish by itself. 
CTRL+C does leave MP3info, but the data isn't saved.
.PP
Using space to erase tags in interactive mode does not work correctly if you 
then backspace over the deleted text.
.PP
The title, author, album, and comment fields are limited to 30 characters.  
This is a limitation of the ID3 1.0 tag format, not MP3Info.  If you specify 
the track number (with the \fB-n\fP switch), the ID3 1.0 tag becomes a 1.1 tag and the 
comment field is limited to 28 characters.  This is because the difference 
between ID3 1.0 and 1.1 is that the tag number is stored in the last byte of 
the comment field.  This trick "borrows" two bytes from the fixed-length
comment field effectively reducing the maximum comment by two characters.
.PP
Genres cannot be specified arbitrarily.  They must be specified from a 
pre-determined list (use \fBmp3info -G\fP to see that list).  Again, this is a 
limitation of the ID3 1.0 tag format.
.PP
Only ID3 versions 1.0 and 1.1 are supported.  Version 3.0 is a "non-standard" 
standard that is much more flexible than the 1.0 standard, but has not yet 
been widely adopted.  The jury is still out.  See www.id3.org for more info.

.SH AUTHOR
Cedric Tefft <cedric@earthling.net>

.SH "SEE ALSO"
\fBprintf\fP(3)\fB