One of the nice things I found in Vista Media Center was the new features in the DVD Library – which now combines DVD Movies with Recorded TV Movies – to give you a single place to find everything. In the past we could only view DVD Titles in this section – and you couldn’t see the ‘Movies on TV’ section unless you were in US or Canda. (so TV Movies were located in amongst all your recorded files and sometimes hard to find).

The DVD Library is enabled via the same "Show Gallery" registry hack found in MCE2005. (You can use MCECustomizer or some other software to set this if you don’t know how).

However, in order to enjoy all the benefits of this new functionality I had to do a couple of things.

I’ll explain the basics here – but hopefully one of the developers out there will make a tool to automate this process (as they have done with DVD Cover grabber/Movie collection editors).

Displaying Covers in the DVD Library for "Recorded TV Shows"

The screenshot below shows the new DVD Library – which has the two sample movie files (that comes included with Vista) – plus a Movie that I recorded from TV "Keeping the Faith". (I haven’t yet added any DVD Titles in this example).

 

In this screenshot – you will notice that the two sample movies have a nice DVD Cover – but my Recorded TV Show doesn’t have one.

Luckily this is simple to fix – and we just need to include a JPEG (.jpg) file (220 x 320 pixels size) – which has the same base filename.

For example if our Recorded TV file was "c:UsersPublicRecorded TVKeeping the Faith.dvr-ms" then the image filename would be "c:UsersPublicRecorded TVKeeping the Faith.jpg".

Once we do this – we now have a cover that we can see :

Metadata in a Recorded TV File?

In the DVD Library in MCE2005 (and Vista) – we were able to change the MetaData for the DVD Movie so additional information was displayed (via supplying dvdid.xml files). There were a few great tools as well for automating this like ‘My DVDs’ etc – which sourced detailed information + covers from AMG, IMDB and Amazon.

We can also change/edit the MetaData for Recorded TV Movies – and update/enter some of the additional details we may know about a Movie (which might be sourced from one of the abovementioned sites) – such as Director, Year of Release, Actors or a Better Description. This will then allow you to do things like view your Movies by Year and get more data/logo’s appearing in the description of the file.

Wheras the Metadata for the DVD Movies are located in a seperate .xml file – for dvr-ms files – the Metadata is embedded into the file itself. You can access/update some of the generic MetaData in this file when you open the file’s properties from Windows Explorer.

By default this Metadata will reflect the details which were found in your EPG in MediaCenter (and are placed in the file’s MetaData Items when the recording commences and the file is created).

The screenshot below shows the default data provided by the EPG for "Keeping the Faith". You will notice there are a few things missing such as the Year of Release.

However – after we change the Metadata – we can have some richer information appearing here.

Editing the MetaData in Recorded TV Files

Stephen Toub (Microsoft) published a great series of articles back in March, 2005 – which provides source code and examples of working with dvr-ms files.

One tool he also provided is the "Edit DVR-MS Metadata" application – which as the name suggests – allows you to view all the MetaData in dvr-ms file and make changes/additions (pictured below). Please see the section What Metadata can be Changed in a Recorded TV File below to find out what fields you should edit/change for Recorded TV Movies.


Programatically changing Metadata in a Recorded TV File?

If you want to make your own tools to do this (as editing files 1 at a time would be very slow for end users) – this information will help you work with dvr-ms Metadata from your code.

If you are a .NET developer – then luckily the libraries/source code you need have been made available by Stephen Toub (which drive the MetaData Editor program pictured above) – in his Article "Fun with DVR-MS".

When you grab the sample and load it up into Visual Studio  – there is a source class file called   .CodeToub.MediaCenter.DvrMsMetadataMetadataEditor.cs .  

To make this task a little simpler – look for the Method MetadataEditor.SetMetadataItemAsString in the abovementioned file – and update it to the following (also add the SetMetadataItemAsBoolean Method supplied below).

public static void SetMetadataItemAsString(IDictionary items, string name, string value)

{

  if (items.Contains(name))

   { items[name] = new MetadataItem(name, value, MetadataItemType.String); }

  else

   { items.Add(name, new MetadataItem(name, value, MetadataItemType.String)); }

}


public
static void SetMetadataItemAsBoolean(IDictionary items, string name, Boolean value)

{

  if (items.Contains(name))

    { items[name] = new MetadataItem(name, value, MetadataItemType.Boolean); }

   else

    { items.Add(name, new MetadataItem(name, value, MetadataItemType.Boolean)); }

}

You can then call these methods in your own code to change the required Metadata (which for what we need to do is just String and Boolean values). The example below opens a file and sets the Metadata Attributes :

  // Open the File..

  DvrmsMetadataEditor editor1 = new DvrmsMetadataEditor("my_filename.dvr-ms");

  Hashtable hashtable1 = (Hashtable)editor1.GetAttributes();

  // Set the MetaData Attributes..

  MetadataEditor.SetMetadataItemAsBoolean(hashtable1, "WM/MediaIsMovie", true);

  MetadataEditor.SetMetadataItemAsString(hashtable1, "Title", "Keeping the Faith");
  MetadataEditor.SetMetadataItemAsString(hashtable1, "WM/SubTitle", "");

  MetadataEditor.SetMetadataItemAsString(hashtable1, "WM/OriginalReleaseTime", "2000-01-01T00:00:00Z");

  .. etc ..

  // Save the MetaData back to the File

  editor1.SetAttributes(hashtable1);

What Metadata can be Changed in a Recorded TV File?

I won’t list all the MetaData you can change (there are over 100 fields in some files I looked at) – however here are some of the important ones you can change for the purpose of using with the DVD Library.

Some Boolean fields we can set (which are all fairly self explanitory by their names) :

"WM/WMRVHDContent"  (Makes the HD Logo Appear)

"WM/MediaIsRepeat"    

"WM/MediaIsStereo"    

"WM/MediaIsMovie" (Must be set to True for it to appear in DVD Library)

There are also some String Fields you can supply

"Title" – The Title of the Movie. (ie. "Police Academy 61")

"WM/SubTitle" – Subtitle of Movie (ie. "Citizens on Patrol")

"WM/SubTitleDescription" – Description of Movie

"WM/Genre" – List of Genres – comma delimetred (ie. ‘Movie,Comedy’)

"WM/Language" – Language Code (ie. "EN", "DE", "FR")

"WM/OriginalReleaseTime" – Year/Date of Release (ie. ‘2000-01-01T00:00:00Z’ – where movie was released in 2000)

and also an important (but trickier) value :

"WM/MediaCredits" – Nominates the list of Actors, Director, Writer(?) and Producer(?). I’m guessing at the last two fields as they aren’t displayed.  The format is (Actors);(Directors);(Producers);(Writers)  – using ‘/’ as the delimeter if you have more then one person in each category.

For example (for the Movie ‘Keeping the Faith’) :  

WM/MediaCredits = "Ben Stiller/Jenna Elfman/Edward Norton/Anne Bancroft;Edward Norton;;Stuart Blumburg"


Where the list at the start is the Actors, followed by the Edward Nortan as the Director and Stuart Blumburg as the Writer. (No Producer is supplied).

Once we make a few changes to this MetaData – we can now view better information for this Movie. See below – the Actors/Directors list is populated (and removed from the description), the Year of Release (2000) is displayed, the HD Logo appears and the Genre is set.

Ensuring Changes Show Up..

Something I was a little unclear with – was how to force MediaCenter to update its cached Recorded File Information (as it didn’t always immediately reflect the changes being made). So I resorted to doing things like moving the file into another directory and moving it back (combined with a title/subtitle change) – which seemed to get it to be re-read. (but wasn’t always 100%)..

I am pretty sure there is some way to change some of the ‘ID’ related MetaData to get MediaCenter to force an update (something to investigate)..

What if my Recorded TV Movies aren’t showing up in the DVD Library?

If you’re Recorded TV Show is not marked as a Movie (in the file metadata) – then it won’t appear in the DVD Library (and will only show up in Recorded TV). As mentioned above – the information about whether it is a movie or not originally comes from the EPG. If you’re using a 3rd Party EPG (or possibly importing files from MCE2005) – then this is likely – as most suppliers don’t set the correct Genre+Attributes on Movies (and instead just create a genre called ‘Movies’).

Luckily – you can still mark the file as a Movie – and using the technique described in the previous section – the MetaData Item you need to set is "WM/MediaIsMovie" – and it must be set to a Boolean value of True. (to indicate the file Is a Movie).

Once this is set – then the file will also appear in both the DVD Library and Recorded TV Shows.

Thats it! – Now someone please make a Util …

Anyhow – thats enough info to get you going if you are a developer. Here’s a big chance to make the ultimate "DVD and Recorded TV Movie Info and Cover Grabber" util that hooks up to one of the Data providers – or to upgrade your existing DVD Cover grabber program if you already made one of these!… We’ll love you for it.. promise..