[PATCH] new tagging implementation

dinkypumpkin dinkypumpkin at gmail.com
Sat May 14 12:09:16 EDT 2011


Something I have been dabbling with for a while -

I have implemented new tagging code in my fork of get_iplayer. This new code:

* Maximises what can be done with id3v2 and AtomicParsley
* Brings MP3 tagging up to par with MP4 (with optional MP3::Tag module)
* Creates a common scheme for generating tags from metadata
* Supports tagging programmes as podcasts (for iTunes users)

Instructions are here:

https://github.com/dinkypumpkin/get_iplayer/wiki/tagging

Pro forma, the associated patch is attached, but it is a bit long.  You may wish to view the changes at Github instead:

https://github.com/dinkypumpkin/get_iplayer/commits/master/

This new code essentially does all it can with AtomicParsley and id3v2, and if you have MP3::Tag installed it will automatically use it to do complete tagging of MP3 files.  So if you want to add thumbnails to MP3 files, or manage your downloads as iTunes podcasts, or just add as much metadata as possible to your files, please have a go.

A description of the tag scheme is linked from the instructions, but the direct link is:

https://github.com/dinkypumpkin/get_iplayer/wiki/tagscheme

There are a few small differences from the previous scheme that are noted in the instructions. The scheme I've implemented has served me well for a couple of years.  I think it preserves the maximum amount of useful information from the metadata generated by get_iplayer.  There may be a slight iTunes bias in the formulation, but the tags also work fine in Winamp, Rhythmbox, QuodLibet, and EasyTag.  Windows Media Player 11 doesn't have any native MP4 tag capability, but various add-ons help it to read M4A tags well enough.  MP4 video was a bit hopeless, but I'm not really bothered about WMP.  I don't know if WMP 12 is any better.

This code was culled from an earlier abandoned experiment to convert my existing Python/Mutagen tagging application into a full-blown, template-driven tagging library for get_iplayer, described here:

https://github.com/dinkypumpkin/get_iplayer_taggerlib/wiki/taggerlib

I posted the library code as a demo of what can be done with a pure Perl approach, particularly with a template-driven system, but it is a dead end.  The template mechanism could be folded into get_iplayer at some point, but I didn't feel it added enough value to justify inclusion now.  The Python system it is based on was built for use in multiple environments, so a more generic mechanism for defining tagging schemes was needed.

Ultimately, I didn't find an MP4 tagging module that worked sufficiently well to justify radical changes in get_iplayer.  More to the point, I didn't find a module that worked as well as or better than AtomicParsley.  Audio::M4P can write all the necessary tags, but it has bugs and quirks that make it a bit fragile.  More importantly, it was never intended for use on large files such as iPlayer video downloads and because of the way it works it is far too slow for use in get_iplayer (e.g., 7+ minutes to tag a 1-hour flashvhigh download).  In the end, I decided that a simpler hybrid approach was the way to go.  Mutagen is still the better library, particularly for MP4, but I've wanted to integrate more complete tagging functionality into get_iplayer for a while.

This change has been incorporated into my get_iplayer fork.  Instructions here:

https://github.com/dinkypumpkin/get_iplayer/wiki/instructions

Commit message follows, patch is attached.

Provides option for full MP3 tagging (with installation of
MP3::Tag module), augments existing tagging with id3v2 and
AtomicParsley, adds option to tag programmes as iTunes podcasts.

See: https://github.com/dinkypumpkin/get_iplayer/wiki/tagging
---
 get_iplayer   |  488 +++++++++++++++++++++++++++++++++++++++++----------------
 get_iplayer.1 |   19 +++
 2 files changed, 368 insertions(+), 139 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-new-tagging-implementation.patch
Type: text/x-patch
Size: 20952 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/get_iplayer/attachments/20110514/4a671c6a/attachment-0001.bin>


More information about the get_iplayer mailing list