Copyright (C) 2000-2012 |
Manpages mp3infoSection: User Commands (1)Updated: July 16, 2001 Index Return to Main Contents NAMEmp3info - MP3 technical info viewer and ID3 tag editorSYNOPSISmp3info [ -h | -G ]mp3info [-x] [-F] [-r a|m|v] [-p FORMAT_STRING] file... mp3info [-d] file...
mp3info [-i] [-t title] [-a artist] [-l album] [-y year] [-c comment] [-n track] [-g genre] file...
DESCRIPTIONmp3info 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.OPTIONS
-p "FORMAT_STRING"
USAGESpecifying MP3 files without any other options displays the existing ID3 tag (if any). Specifying a track number of 0 reverts an ID3 tag to 1.0 format Non-specified ID3 fields, if existant, will remain unchanged. Genres can be specified as numbers or names: -g 17 same as -g Rock Multiple word fields must be enclosed in quotes (eg: -t "A title") NOTES
EXAMPLESDisplay existing ID3 tag information (if any) in song.mp3
Set the title, author and genre of song.mp3. (All other fields unchanged)
Set the album field of all MP3 files in the current directory to "The White Album"
Delete the entire ID3 tag from song1.mp3 and song2.mp3
Delete the comment field from the ID3 tags of all MP3 files in the current directory. (All other fields unchanged)
Display the Title, Artist, Album, and Year of all MP3 files in the current directory. We include the labels 'File', etc. and insert newlines (\n) to make things more readable for humans:
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 (\t) character. Note that you must include a newline (\n) at the end of the format string in order to get each file's information on a separate line. Here's the command:
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.
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 (-) in front of the field-width:
Now suppose you just want the running time of each MP3 file specified in minutes and seconds. Simple enough:
You may notice when you do this, however, that leading zeros are not displayed in the seconds field (%s). 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:
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.
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:
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:
BUGSThere'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.Using space to erase tags in interactive mode does not work correctly if you then backspace over the deleted text. 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 -n 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. Genres cannot be specified arbitrarily. They must be specified from a pre-determined list (use mp3info -G to see that list). Again, this is a limitation of the ID3 1.0 tag format. 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. AUTHORCedric Tefft <cedric@earthling.net>SEE ALSOprintf(3)
IndexThis document was created by man2html, using the manual pages. Time: 09:05:18 GMT, April 25, 2024 |