Automating Adding iTunes Album Art to MP3 ID3 tags from the Command Line in C#
It's been bugging me that the album art for my podcast doesn't appear in Windows Media Player, iTunes, or in iPods.
I assumed, incorrectly, that this was an iTunes meta-tagging problem, but then I realized that this was an MP3 problem, not an AAC or WMA problem, although both formats support adding art to the file.
The ID3 format is pretty extensive. You can put a great deal of meta-information into an MP3. The Attached picture or APIC "Frame" in ID lets you embed in PNGs or JPGs, along with their respective mime/types.
I googled around over lunch and couldn't find a simple, free, command-line program that would let me easily add pictures to not only the existing MP3s for our show on the server-side, but also could be integrated into our existing audio file production workflow.
I ended up finding this great little library from 2004 called the tagnetlib project source was offered for free from the Nancy Street Blog. I converted it to .NET 2.0.
Now, note that the tagnetlib project is currently deprecated in lieu of the NTag product that Greg Keogh started in 2005 and released in May of 2006. The NTag project is much more interesting and appears to be well thought-out. He intends to support WMA and OGG and turn the project info a "Meta Tag Tagging" project that would support all popular audio formats.
I used the Tagnetlib because it was quick, incredibly easy, and I only had my lunch hour to do this. However, he's pretty clear that Tagnetlib is, again, totally deprecated and unsupported. Perhaps one day I'll get to spend more time with the NTag library. For now, my little hack is used like this:
embedid3.exe file.mp3 file.jpg [optionally "mime/type", default is "image/jpeg"]
Disclaimer: This app does one thing. It adds images to MP3 files that don't have them. It has no error handling or checking and it doesn't care about you or your MP3 collection. Don't even think about running it over your collection or using it for any purpose. It's useful for one thing. It's useful to me. Your Mileage WILL Vary. You have been warned.
Do make sure you checkout NTag and what Greg's working on over there. It's really pretty fun code to read.