views:

421

answers:

7

Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?), but the more it can do (eg EXIF from images?) the better without compromising the ID3 tag reading abilities.

I'm interested in making a script that goes through my media (right now, my music files) and makes sure the file name and directory path correspond to the file's metadata and then create a log of mismatched files so I can check to see which is accurate and make the proper changes. I'm thinking Ruby or Python (see a related question specifically for Python) would be best for this, but I'm open to using any language really (and would actually probably prefer an application language like C, C++, Java, C# in case this project goes off).

+1  A: 

There is a great post on using PowerShell and TagLibSharp on Joel "Jaykul" Bennet's site. You could use TagLibSharp to read the metatdata with any .NET based language, but PowerShell is quite appropriate for what you are trying to do.

Steven Murawski
+1  A: 

@Steven Murawski: Not everyone has PowerShell installed, so I would like to stick to a conventional scripting or programming language.

Thomas Owens
A: 

@Thomas Owens PowerShell is now part of the Common Engineering Criteria (as of Microsoft's 2009 Product Line) and starting with Serve 2008 is included as a feature. It stands as much of a chance to be installed as Python or Ruby. You also mentioned that you were willing to go to C#, which could use TagLibSharp. Or you could use IronPython...

Steven Murawski
A: 

@Steven Murawski: I bookmarked TagLib# for future reading, but it looks good. This might also be my chance to finally do some more .NET programming. I've been doing too much PHP and JavaScript at work. I might accept your answer later, unless someone can blow that one out of the water, which I doubt.

Thomas Owens
A: 

@Thomas Owens TagLibSharp is a nice library to use. I always lean to PowerShell first, one to promote the language, and two because it is spreading fast in the Microsoft domain. I have nothing against using other languages, I just lean towards what I know and like. :) Good luck with your project.

Steven Murawski
+1  A: 

use exiftool (it supports ID3 too). written in perl, but can also be used from the command line. it has a compiled windows and mac version.

it is light-years ahead of any other metadata tool, supporting almost all known audio, video and image files, supports writing (not just reading), and knows about all the custom/extended tags used by software (such as photoshop) and hardware (many camera manufacturers).

A: 

Further to Anon's answer - exiftool is very powerful and supports a huge range of file types, not just images, but video, audio and numerous document formats.

A Ruby interface for exiftool is available in the form of the mini_exiftool gem

see http://miniexiftool.rubyforge.org/

Noel Walters