The University of Queensland Homepage
School of ITEE ITEE Main Website

 Automated Creation of TAG (ID3) Files for the EVA
Last update: November 12, 2010

Note

This project and the TagEdit project have been combined into TagSuite. Please check that page for the latest version.

Background

This page describes a tool written to automatically create "TAG" files for the video media files played by the Netgear 8000 and 91xx Digital Entertainer (DE) series of home entertainment media servers. TAG files enhance the display selection pages by providing still image clips and synopsis information while browsing and playing the available media selections. They are based on version 2.4 of the ID3 specification. More information on the ID3 format is available at http://id3.org.

The tool is based on earlier work done by Tom Briden on a Linux based command line tool (the original script is available here: TagTool.zip). Tom's tagtool was written in Perl and was intended primarily for Linux/Unix, although it could probably be made to run under ActiveState Perl on Windows machines provided the user was sufficiently familiar with Perl to install the required modules, two of which are not in the ActiveState repository and must be loaded from Cpan—a simple process under Linux, but not for the feint hearted on Windows.

The author used the original version under Fedora Linux to successfully create hundreds of TAG files in single and batch modes. In the process, a few annoying problems were addressed in the tool source, and in one of the non-standard modules (TVDB::API). The author also found it hard to remember all the command line options, resorting to a template shell script to assist. About this time the TagEdit GUI tool was written to check and fine-tune the generated TAG files. Experience with this tool, and success turning it into a Windows self-contained executable with ActiveState's Perl Developer Toolkit suggested that a GUI wrapper around Tom's tagtool might be an advantage for all.

Development

The inner process and logic remains essentially the same as that written by Tom Briden (tbriden AT hotmail DOT com) with modifications by Loci (loci AT locimotive DOT de). The original was somewhat monolithic in nature, so it has been refactored into a perl module (class) that can be invoked once by a wrapper command line program, or repeatedly by a GUI wrapper. Several modifications and additional features have been added and the external Cpan modules included as part of the distribution source so that Windows installation is simplified. A few bugs were fixed and certain naming and formatting conventions were applied to the author's taste.

Another refinement was added to make the original modules less "chatty" and reliant on output to STDOUT and STDERR. This was done by creating a very simple Perl logging package (Logging::Simple) which defaults output to the verbose channel of Debug::Simple, but can be told to use another, externally provided output function. This enables progress and error messages to be printed to the console as before, or to the GUI as they happen.

The GUI wrapper has been written using the Perl Tk module which has prooven more than adequate as a cross-platform GUI environment for TagEdit. Essentially, both GUI and command line versions simply collect and validate parameters which are passed to the main Tagmaker instance to produce TAG files on a single per media file association basis, or in batch for all media files recursively found from a specified directory.

Current Progress

  1. The tag generation components of the original tool have been refactored as a Perl package (Tagmaker.pm).
  2. A new command line wrapper (tagtool2.pl) has been written to validate the functionality of the Tagmaker.pm module. This has been tested enough that the author now uses it in place of the original tagtool. Operation is very similar to the original Briden/Loci tool and will be maintained for cases where a command line tool is just what the doctor ordered.
  3. The GUI wrapper version (tagmaker.pl) is complete to the same stage as the command line version. It has been validated as generating the same results as the command line version under Linux and MS Windows.

Operation

The downloads below provide all but the "common" Perl modules required to run the command line and GUI versions of the program under Linux or Windows (using ActiveState Perl and a DOS shell). For those Windows users who just want see what it will do, the zip includes Windows executables of both utilities. This command line version must be run from a DOS shell in the directory created by the distribution tar or zip. This allows the mandatory and optional arguments can be supplied. The more savvy might wish to create a shell or batch script so all media files can be retagged with a single command. For the GUI version, one Windows exe will do the job from a double-click and there is no restriction on where the binary file can be located—it is fully self contained, including the external help file. As noted on the TagEdit page, there are restrictions on the version of Perl that can be used if you want to run it using a Perl interpreter. The screenshot at right shows the GUI version after a run. The tool includes full Help on all the options which may be viewed here.

There are also a restriction on the Windows version not applicable to the Linux version relating to auto image inclusion. Simply stated, it does not work under Windows (due to bugs in a low level library) and will result in a corrupt TAG file. This file can be fixed with TagEdit by using "permissive" mode to load it, then save it without the image. A simpler approach is to just use the "-exclude-cover" switch to prevent an image being included. Images can be added later with TagEdit.

Running the command line version of the program (named tagtool2.pl) with no arguments, or "-h" will list all the mandatory and optional parameters. The help should explain sufficiently what each does. Expanded information appears in the HTML Help where the GUI and correcponding command-line options are explained.

Tagmaker draws its data from one of two sources, the Internet Movie Database (IMDb) or the Online TV database (TheTVDB). It has been observed that the TVDB occasionally performs poorly tested live updates to their HTTP/XML API that result in bogus, broken XML being sent to clients. As this is cached locally, the cache can become "poisoned" for select TV series for all time! If you experience strange errors mentioning XML, use the "-purge" option do delete all cached data (after waiting a few hours for the TVDB folk to fix their problems as the howls of protest arrive).

Downloads

The first link below provides the tool compiled for execution under Microsoft Windows XP SP3, with full source code, dummy media files for testing, and the current Release Notes in .zip format. The second, smaller download excludes the Windows executable, providing all the rest as a tar.gz for Linux/Unix users.

These links will always link to the latest version (see the Release Notes).

ActiveState Perl for MS Windows for those who want to run the code inside an interpreter and experiment with the source is available for free download from ActiveState.

Availability

Tagmaker is provided as-is under a Creative Commons, Attribution-Noncommercial-Share Alike 3.0 License (See http://creativecommons.org/licenses/by-nc-sa/3.0). That is, you can do what you like with it except ask money for it, or any modified form of it, and must acknowledge the original authors. If you need to contact me, see my UQ ITEE Home Page for contact details. Finally and naturally, I don't suggest nor imply that the program is good for anything at all.