[ID3 Dev] Reading Tags into a Database

Michael Makuch mike at muzikbrowzer.com
Tue Jan 11 07:45:14 PST 2011


If you prefer command line & scripting to GUIs I have 2 command line utilities I
use; id3 and mbtag.exe

id3 is based on the prog that's in the id3lib source, modified to my liking.
mbtag.exe (win only) is also based similarly on id3lib, but it also does
read/writing of .ogg, .wma, and .flac.

id3 src: http://www.muzikbrowzer.com/dl/id3.zip (requires id3lib)
mbtag.exe http://www.muzikbrowzer.com/dl/mbtag.zip (no installer, just a command
line exe)

mbtag.exe also comes along with Muzikbrowzer when you install it
http://www.muzikbrowzer.com/

Below are the usage of both utils.

Cheers
Mike


$ id3
id3 [options] <file> # w/out options display tag info.  options:
     -v      <value> # id3 version (1 or 2)
     -dt             # delete tag (version 1 or 2 if specified else both
     -df     <value> # delete tag field
     -ds             # delete some fields
     -getart <value> # getart, writes to <file>
     -TCON   <value> # genre
     -TPE1   <value> # artist
     -TALB   <value> # album
     -TIT2   <value> # title
     -TRCK   <value> # track
     -TLEN   <value> # length
     -TYER   <value> # year
     -TPOS   <value> # part in set
     -TPUB   <value> # publisher
     -UFID   <value> # ufid
     -TMED   <value> # dig...
     -COMM   <value> # comment
     -APIC   <value> # art file, reads from <file>

$ ./mbtag.exe  -help
mbtag from Muzikbrowzer www.muzikbrowzer.com
Standalone command line tag editor/viewer. Feel free
to distribute mbtag.exe.

usage:
mbtag [options] <file> # w/out options display tag info.  options:
     -k      <value> # key, use with -v
     -v      <value> # val, use with -k to set key/val
     -dt             # delete tag
     -df     <value> # delete tag field
     -c              # display comments only (COMM, COMMENTS, DESCRIPTION
     -getart <value> # gets art from tag, writes to <file> (mp3/ogg)
     -setart <value> # read from <file>, add to tag (mp3/ogg)
     -help           # full help

Examples:

Set Genre:
   mbtag -k TCON -v "Texas Rock" Fandango.mp3
   mbtag -k GENRE -v RockAndRollBaby ElvisLives.flac
Set Artist:
   mbtag -k WM/AlbumArtist -v RockAndRollBaby ElvisLives.wma
   mbtag -k ARTIST -v "The King" ElvisLives.ogg
   mbtag -k TPE1 -v "XYZZY" TwistyLittleMaze.mp3

id3 keys converted to appropriate corresponding key when used on
ogg, flac, wma files. Example:
   mbtag -k TCON -v "Classical" BethovensFifth.ogg
      is converted to
   mbtag -k GENRE -v "Classical" BethovensFifth.ogg

id3 keys supported: TCON,TPE1,TALB,TIT2,TRCK,TYER,COMM
ogg, flac, wma: anything goes
For wma's only type STRING fields are supported.






On 1/11/2011 7:00 AM, John Slane wrote:
> Beautiful.  That is very useful info.
>
> I very much look forward to trying this out during the coming weekend.  It
> looks like it may give me much more flexibility in organizing my library than
> can be achieved with the popular library/player packages.
>
> Thanks very much for taking time to help me.
>
> *From:* Peter Bennett <pgbennett at comcast.net>
> *To:* John Slane <jaslane64 at yahoo.com>
> *Cc:* "id3v2 at id3.org" <id3v2 at id3.org>
> *Sent:* Monday, January 10, 2011 8:36:32 PM
> *Subject:* Re: [ID3 Dev] Reading Tags into a Database
>
> Jampal writes to the windows registry using the java preferences API. It only
> uses the registry for the most recently used list for the "File" "Open" menu.
> It uses a key of "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\pgbennett\jampal".
> If you are running on Linux or Unix it uses a file in your home directory for
> this purpose instead.
> All other options are either written to the library file itself or to
> jampal-initial.properties in a .jampal directory that is created in your home
> directory in windows or Unix.
> If there are any frames that Jampal does not support or understand, it leaves
> them untouched. You can use jampal to delete unsupported frames but not to add
> or update them.
> The command line program tagupdate follows the same rules and uses the same
> code as the GUI.
> Peter
>
>
>
> On 1/10/2011 12:56 PM, John Slane wrote:
>> Thank you very much for the head-up on your program.  I have cruised through
>> SourceForge and other favorite resources, looking for something like this.  I
>> don't know how I missed it.  I look forward to giving this a go during the
>> coming weekend.
>>
>> Although I will figure it out eventually, perhaps you can comment -- if you
>> have time:
>>
>> 1) Does the program write to the Windows registry?
>>
>> 2) mp3Gain writes (if I remember correctly) to APE tags.  Could those be
>> affected/corrupted in any way through use of jampal?
>>
>> Once again, thanks for helping me out on this one.
>>
>> John
>>
>> *From:* Peter Bennett <pgbennett at comcast.net> <mailto:pgbennett at comcast.net>
>> *To:* id3v2 at id3.org <mailto:id3v2 at id3.org>; John Slane <jaslane64 at yahoo.com>
>> <mailto:jaslane64 at yahoo.com>; Chris Morton <salt.morton at gmail.com>
>> <mailto:salt.morton at gmail.com>
>> *Cc:*
>> *Sent:* Saturday, January 8, 2011 1:44:48 PM
>> *Subject:* Re: [ID3 Dev] Reading Tags into a Database
>>
>> You can download my program Jampal ( http://jampal.sf.net ). This creates a
>> library from your mp3 files. The library can be customized to contain any
>> combination of mp3 frames you specify. The libraray is a file with extension
>> jmp and is a csv (comma separated text file) encoded with UTF-8. If you can
>> read a comma separated file this can do what you want. Also there is a
>> command line program included with Jampal, TagUpdate, which can print the
>> full contents of tags, also can update them. The print output would have to
>> be parsed to be usable for importing to SQL.
>>
>> Peter
>>
>>
>> On 1/4/2011 1:55 PM, John Slane wrote:
>>> Thanks, Chris.  Boy, those are some great sites!  I haven't yet found my
>>> answer to my original question, but I've found lots of other really
>>> interesting stuff.  I'll do some better digging in those sites tonight.
>>>
>>> Again, thanks.
>>>
>>> ps.  I have learned that Mp3tag can export CSV, and that TkSQLite can import
>>> CSV.  So maybe there is a combo of these that will create my ID3 database.
>>>
>>> *From:* Chris Morton <salt.morton at gmail.com> <mailto:salt.morton at gmail.com>
>>> *To:* id3v2 at id3.org <mailto:id3v2 at id3.org>
>>> *Cc:*
>>> *Sent:* Tuesday, January 4, 2011 1:03:33 PM
>>> *Subject:* Re: [ID3 Dev] Reading Tags into a Database
>>>
>>> /I don't have an answer, but you might also try the crowds over at:/
>>>  
>>> http://yabb.jriver.com/interact/index.php?PHPSESSID=8392cbc25b0419846a059bcac1e0e5a3&board=5.0
>>>  
>>> http://anythingbutipod.com/forum/forumdisplay.php?f=23
>>>  
>>> /and/
>>>  
>>> http://forums.rockbox.org/index.php?PHPSESSID=bfbcac48f5553c499ecc8e2963cbe8e1&board=33.0
>>>  
>>> /> Chris/
>>>  
>>>
>>>
>>>  
>>> On Tue, Jan 4, 2011 at 9:54 AM, John Slane <jaslane64 at yahoo.com
>>> <mailto:jaslane64 at yahoo.com>> wrote:
>>>
>>>     I hope this is a legitimate question for this mailing list.  Given the
>>>     audience, I figured it was worth a shot.
>>>
>>>     Does anyone know of a software program (preferably free) that will read
>>>     the ID3 tags from a Windows folder full of mp3 files and pump them into
>>>     something like an SQLite database?  It would be important to also
>>>     capture the path to each file file location.
>>>
>>>     I can do this using popular software like MediaMonkey, since its
>>>     "Library" is an SQLite database that contains the ID3 info and path info
>>>     for each file selected.  Songbird also creates an SQLite DB.  But these
>>>     are big programs containing players and other baggage. 
>>>
>>>     Is there something out there that will just collect the tag and path
>>>     info, and arrange it into a searchable/sortable database?
>>>
>>>     Thanks!
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.id3.org/pipermail/id3v2/attachments/20110111/d36f95ab/attachment.html>


More information about the ID3v2 mailing list