"Fossies" - the Fresh Open Source Software Archive 
Member "mp3info-0.8.5a/mp3info.txt" (6 Nov 2006, 16779 Bytes) of package /linux/misc/old/mp3info-0.8.5a.tgz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 mp3info(1) mp3info(1)
2
3
4
5 NAME
6 mp3info - MP3 technical info viewer and ID3 tag editor
7
8
9 SYNOPSIS
10 mp3info [ -h | -G ]
11
12 mp3info [-x] [-F] [-r a|m|v] [-p FORMAT_STRING] file...
13
14 mp3info [-d] file...
15
16 mp3info [-i] [-t title] [-a artist] [-l album] [-y year] [-c comment]
17 [-n track] [-g genre] file...
18
19
20 DESCRIPTION
21 mp3info is a utility used to read and modify the ID3 tags in MPEG layer
22 3 (MP3) files. It can also (optionally) display various technical
23 attributes of the MP3 file.
24
25
26 OPTIONS
27 -a artist
28 Specify ID3 artist name
29
30 -c comment
31 Specify ID3 comment
32
33 -g genre
34 Specify ID3 genre (use -G option for a list of valid genres).
35 You may specify either a genre name or a number.
36
37 -l album
38 Specify ID3 album name
39
40 -n track
41 Specify ID3 v1.1 track number
42
43 -t title
44 Specify ID3 track title
45
46 -y year
47 Specify ID3 copyright year
48
49 -G Display a list of valid genres and their associated numeric
50 codes. These are the only values accepted by the -g switch.
51
52 -h Display a help page
53
54 -x Display technical attributes of the MP3 file
55
56 -r a|m|v
57 Report bit rate of Variable Bit Rate (VBR) files as one of the
58 following (See the section below entitled Bit Rates for more
59 information):
60
61 a - Average bit rate [float](Note: this option also causes the
62 bit rates of non-VBR files to be displayed as floating
63 point values).
64 m - Median bit rate [integer]
65 v - Simply use the word 'Variable' [string] (this is the
66 default).
67
68 -i Edit ID3 tag interactively (uses curses/ncurses functions)
69
70 -d Delete ID3 tag (if one exists)
71
72 -f Force Mode: Treat all files as MP3s even if MP3 frames can't be
73 found
74
75 -F Do a Full scan for technical information (see the section Speed
76 Considerations below for more information)
77
78 -p "FORMAT_STRING"
79
80 Print MP3 attributes according to FORMAT_STRING. FORMAT_STRING
81 is similar to a printf(3) format string in that it is printed
82 verbatim except for the following conversions and escape
83 sequences. Any conversion specifier may optionally include the
84 various alignment, precision, and field width modifiers accepted
85 by printf(3). See the EXAMPLES section below for examples of
86 how format strings are used in mp3info.
87
88
89 Conversion Specifiers
90
91 %f Filename without the path [string]
92 %F Filename with the path [string]
93 %k File size in KB [integer]
94 %a Artist [string]
95 %c Comment [string]
96 %g Musical genre [string]
97 %G Musical genre number [integer]
98 %l Album name [string]
99 %n Track [integer]
100 %t Track Title [string]
101 %y Year [string]
102 %C Copyright flag [string]
103 %e Emphasis [string]
104 %E CRC Error protection [string]
105 %L MPEG Layer [string]
106 %O Original material flag [string]
107 %o Stereo/mono mode [string]
108 %p Padding [string]
109 %v MPEG Version [float]
110 %u Number of good audio frames [integer]
111 %b Number of corrupt audio frames [integer]
112 %Q Sampling frequency in Hz [integer]
113 %q Sampling frequency in KHz [integer]
114 %r Bit Rate in KB/s (type and meaning affected by -r
115 option)
116 %m Playing time: minutes only [integer]
117 %s Playing time: seconds only [integer] (usually used in
118 conjunction with %m)
119 %S Total playing time in seconds [integer]
120 %% A single percent sign
121
122 Escape Sequences
123
124 \n Newline
125 \t Horizontal tab
126 \v Vertical tab
127 \b Backspace
128 \r Carriage Return
129 \f Form Feed
130 \a Audible Alert (terminal bell)
131 \xhh Any arbitrary character specified by the hexidecimal
132 number hh
133 \ooo Any arbitrary character specified by the octal number
134 ooo
135 \\ A single backslash character
136
137
138
139 USAGE
140 Specifying MP3 files without any other options displays the existing
141 ID3 tag (if any).
142
143 Specifying a track number of 0 reverts an ID3 tag to 1.0 format
144
145 Non-specified ID3 fields, if existant, will remain unchanged.
146
147 Genres can be specified as numbers or names: -g 17 same as -g Rock
148
149 Multiple word fields must be enclosed in quotes (eg: -t "A title")
150
151
152 NOTES
153 Speed Considerations
154 In order to determine certain technical attributes (playing
155 time, number of frames, number of bad frames, and in a few cases
156 the bit rate) with absolute certainty, it would be necessary to
157 read the entire MP3 file. Mp3info normally tries to speed
158 things up by reading a handful of frames from various points in
159 the file and estimating the statistics for the rest of the file
160 based on those samples. Usually, this results in very accurate
161 estimates. Audio playing times are usually off by no more than
162 a second, and the number of frames is off by less than 0.1%.
163 Often the estimates agree exactly with the full scans. Never-
164 theless, the user may wish to ensure that she is getting exact
165 information.
166
167 One should specify the -F switch if one wants mp3info to read
168 the entire MP3 file when determining this information. Note
169 that a full scan will only affect mp3info's output if the -x
170 switch is used or the -p switch is used with a FORMAT_SPECIFIER
171 containing %m, %s, %S, %u or (rarely) %r. Using the -F switch
172 under other conditions will only slow down mp3info. Also note
173 that a FORMAT_SPECIFIER containing %b or a VBR MP3 file will
174 automatically trigger a full scan even if the -F switch is not
175 used.
176
177 Several users have noted that the %u specifier used alone:
178
179
180 mp3info -p "%u" song.mp3
181
182 sometimes gives a different number of good frames than when used
183 with the %b specifier:
184
185 mp3info -p "%u %b" song.mp3
186
187 This is because when you use %u by itself, mp3info only esti-
188 mates the number of frames based on the bitrate and the size of
189 the file. When you use the %b specifier, you force mp3info to
190 do a full scan of the file which guarantees an accurate count of
191 both the good and bad frames. If you want to guarantee an accu-
192 rate count of the number of good frames when using %u by itself,
193 you should use the -F option.
194
195
196 Bit Rates
197 MP3 files are made up of many (usally several thousand) audio
198 blocks called 'frames'. Each of these frames is encoded at a
199 specific 'bit rate' which determines both the quality of the
200 sound and the size of the frame itself. Bit rates can range
201 from 8 Kb/s (kilobits per second) to 320 Kb/s. Note that the
202 MP3 specification only allows 14 discreet bit rates for an MP3
203 file, so, for instance, a stereo MP3 could have frames with bit
204 rates of 128 Kb/s and 160 Kb/s, but nowhere in between.
205
206 Audio frames with high bit rates sound much better than those
207 with lower bit rates, but take up more space. Obviously, one
208 would like to use a bit rate that is only high enough to main-
209 tain a comfortable level of audio quality. Normally, all the
210 frames in an MP3 file are encoded at the same bit rate. A few
211 MP3 files, however, are encoded such that the bit rate may vary
212 from one frame to the next. These MP3 files are called Variable
213 Bit Rate (or VBR) files. Since VBR files do not have one sin-
214 gle bit rate, attempting to report the bit rate of the file as a
215 whole can be problematic. Consequently, mp3info allows you to
216 specify how you want this value reported.
217
218 The default is to simply print the word 'Variable' where the bit
219 rate would normally appear. Another option is to print the
220 mathematical average of all the frames. This has the advantage
221 of being completely accurate, but the number printed may not
222 correspond to one of the 14 discreet bit rates that would be
223 allowed for that file. The third alternative solves that prob-
224 lem by allowing the bit rate to be reported as the median bit
225 rate which is what you would get if you lined up all the frames
226 in the file by bit rate from lowest to highest and picked the
227 frame closest to the middle of the line.
228
229 For more specific usage information, see the -r switch and the
230 %r conversion specifier under the description of -p's FOR-
231 MAT_SPECIFIER.
232
233
234
235 EXAMPLES
236 Display existing ID3 tag information (if any) in song.mp3
237
238
239 mp3info song.mp3
240
241 Set the title, author and genre of song.mp3. (All other fields
242 unchanged)
243
244 mp3info -t "Song Title" -a Author -g "Rock & Roll" song.mp3
245
246 Set the album field of all MP3 files in the current directory to "The
247 White Album"
248
249
250 mp3info -l "The White Album" *.mp3
251
252 Delete the entire ID3 tag from song1.mp3 and song2.mp3
253
254 mp3info -d song1.mp3 song2.mp3
255
256 Delete the comment field from the ID3 tags of all MP3 files in the cur-
257 rent directory. (All other fields unchanged)
258
259 mp3info -c "" *.mp3
260
261 Display the Title, Artist, Album, and Year of all MP3 files in the cur-
262 rent directory. We include the labels 'File', etc. and insert newlines
263 (\n) to make things more readable for humans:
264
265 mp3info -p "File: %f\nTitle: %t\nArtist: %a\nAlbum: %l\nYear:
266 %y\n\n" *.mp3
267
268 Say you want to build a spreadsheet of your MP3 files. Here's a com-
269 mand you might use to help you accomplish that. Most spreadsheet pro-
270 grams will import an ASCII file and treat a given character as a field
271 separator. A commonly used field separator is the tab character. For
272 each MP3 file in the current directory, we want to output the filename,
273 title, artist, and album on a single line and have the fields separated
274 by a tab (\t) character. Note that you must include a newline (\n) at
275 the end of the format string in order to get each file's information on
276 a separate line. Here's the command:
277
278 mp3info -p "%f\t%t\t%a\t%l\t%y\n" *.mp3
279
280 Some spreadsheets or other software may allow importing data from flat
281 files where each field is a specific width. Here's where the format
282 modifers come into play. This next command outputs the same informa-
283 tion as the command above, but uses fixed-width fields instead of tab
284 separators. The filename field is defined as 50 characters wide, the
285 title field is defined as 31 characters wide, and so on.
286
287 mp3info -p "%50f%31t%31a%31l%4y\n" *.mp3
288
289 The problem with the output of this command is that all strings are
290 normally right- justified within their fields. This looks a little odd
291 since most western languages read from left to right. In order to make
292 the fields left-justified, add a minus sign (-) in front of the field-
293 width:
294
295 mp3info -p "%-50f%-31t%-31a%-31l%-4y\n" *.mp3
296
297 Now suppose you just want the running time of each MP3 file specified
298 in minutes and seconds. Simple enough:
299
300 mp3info -p "%f: %m:%s\n" *.mp3
301
302 You may notice when you do this, however, that leading zeros are not
303 displayed in the seconds field (%s). So for instance, if you had a
304 track four minutes and two seconds long its running time would be dis-
305 played as '4:2' instead of '4:02'. In order to tell mp3info to pad an
306 integer field with zeros, you need to use a field width modifier and
307 place a zero in front of it. The following command is the same as the
308 previous one, but it specifies that mp3info is to display the seconds
309 field with a fixed field-width of two characters and to pad the field
310 with leading zeros if necessary:
311
312 mp3info -p "%f: %m:%02s\n" *.mp3
313
314 The last trick we have to show you is the precision specifier for
315 floating point variables. The following command displays the filename
316 and average bit rate for all MP3 files in the current directory.
317
318 mp3info -r a -p "%f %r\n" *.mp3
319
320 By default, the floating point value of the average bit rate is dis-
321 played with six digits past the decimal point (ex: 175.654332). If you
322 are like me, this seems like a bit of overkill. At most you want one
323 or two digits beyond the decimal place displayed. Or you might not
324 want any. The following command displays the average bit rate with
325 first two, then zero digits beyond the decimal point:
326
327 mp3info -r a -p "%f %.2r %.0r\n" *.mp3
328
329 If you wanted to specify a field width for a floating point value, you
330 could do that by placing the field-width before the decimal point in
331 the field modifier. This command does just that -- specifying an aver-
332 age bit-rate field six characters wide that will show two digits of
333 precision beyond the decimal point:
334
335 mp3info -r a -p "%f %6.2r\n" *.mp3
336
337 BUGS
338 There's no "save and quit" in interactive mode. You must fill in all
339 the fields (even if it is with blanks) and let the program finish by
340 itself. CTRL+C does leave MP3info, but the data isn't saved.
341
342 Using space to erase tags in interactive mode does not work correctly
343 if you then backspace over the deleted text.
344
345 The title, author, album, and comment fields are limited to 30 charac-
346 ters. This is a limitation of the ID3 1.0 tag format, not MP3Info. If
347 you specify the track number (with the -n switch), the ID3 1.0 tag
348 becomes a 1.1 tag and the comment field is limited to 28 characters.
349 This is because the difference between ID3 1.0 and 1.1 is that the tag
350 number is stored in the last byte of the comment field. This trick
351 "borrows" two bytes from the fixed-length comment field effectively
352 reducing the maximum comment by two characters.
353
354 Genres cannot be specified arbitrarily. They must be specified from a
355 pre-determined list (use mp3info -G to see that list). Again, this is
356 a limitation of the ID3 1.0 tag format.
357
358 Only ID3 versions 1.0 and 1.1 are supported. ID3V2 is a much more pow-
359 erful standard and is planned for some as-yet-undetermined future ver-
360 sion. Unfortunately, a clean implementation is a heck of a lot of work
361 and I'm unbelievably lazy, so don't hold your breath. It is probably
362 worth noting at this juncture, however, that I do accept patches. :-)
363
364 Exit codes are somewhat haphazard and not well documented.
365
366
367 AUTHOR
368 Cedric Tefft <cedric@phreaker.net>
369
370
371 SEE ALSO
372 printf(3)
373
374
375
376 mp3info November 6, 2006 mp3info(1)