Big Screen Blog

Media Center, Windows Phone7 + Silverlight Goodness..

Hack: Enabling Recorded TV Movies with full info in the DVD Library

with 11 comments

 
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..
 
 
 
 
 
 
Advertisements

Written by mobilewares

November 26, 2006 at 7:53 am

Posted in Vista MediaCenter

11 Responses

Subscribe to comments with RSS.

  1. Or just write a utility that strips the metadata out of a dvrms file into an xml file – now that could be a handy utility…. Say if your record Keep-the-faith.dvrms – then you run this utility it creates a Keey-the-faith.xml file which contains all the xml items like title, description etc…Why do this – so when you create divx files using something like crunchie – and hence you loose the metadata, At least if you had a utility to strip it, you could keep it…
    Well thats just a late night rant – I have been going to do this for awhile…. write sucha util… One day eh? But seriously – if your reading this… then why are you not commenting on stuff of Niall’s – he is doing some good work here and probably deserves a little feedback…
    So someone – come on make some comments!

    Impact (Keith Chambers)

    November 26, 2006 at 1:33 pm

  2. Is there something different about dvr-ms files created in Vista MC that prevents Toub’s editor from working with them? I’m referring to his dvr-ms editor that he mentions in his blog post here: http://blogs.msdn.com/toub/archive/2005/05/12/416874.aspx
     
     

    Joseph

    November 26, 2006 at 11:41 pm

  3. Hi,
     
    Ok I didn’t see this other post by him (and will update the article now) – so yes this tool will help you do what you need (without being a programmer!).
     
    This article I think will still be useful if either
    a) you need to know what fields to edit and what makes makes the DVD Library tick for Recorded TV..
    or  
    b) you want to write a full end-to-end solution for doing this (as editing 1 file at a time – and copying/pasting from a website using stephen’s tool would be very slow)..  the link i did provide above will allow you to grab the source code you need (as the other link you mention is just a .exe file with no source code)
     
    Niall
     

    Niall

    November 26, 2006 at 11:55 pm

  4. Interesting information. Thanks Niall.
     
    Its probably not that hard from what I have created and what I am creating now (DVD Cover Grabber).
    I will give it a shot.
     
    Euan
     
     

    Unknown

    November 28, 2006 at 3:51 am

  5. Great info!  Any idea how to add a cover pic for a DVD? (the ISO/VOB kind)

    Digital Rebel

    December 17, 2006 at 5:09 am

  6. Let me know when anyone does it that would be great
    I have tried this cover grabber works OK but but a bit manual and no info
    http://www.madprops.org/dvdcover/
     
    Have anyone managed to add cover and info grabbing to Vista yet?

    Grahame Edwards

    January 11, 2007 at 9:38 pm

  7. would there be anyway of helping me out?  I need to change the WM/MediaClassPrimaryID and the SecondaryID in a .wmv file.  Both of these tags are GUID’s.  I took and editied the toub.mediacenter source to ass a SetMetadataAsGUID, but i’m still having problems.  can you help?

    Michael

    March 4, 2007 at 3:03 pm

  8. Hi Shane.. I haven’t tried to do this one – but seem to remember that you need to save the GUID’s as an Array of Bytes (which I think that SetMetadataasGUID does too) – and of course that you need to save/handle the WMV metadata differently to DVR-MS. If this isn’t working – it might be worth pinging Stephen Toub and see if he has any ideas (as he is the guru on this stuff).
     

    Niall

    March 5, 2007 at 4:15 am

  9. ok, i might be missing something here but how do i get my "Recorded TV" into "DVD Library" ? where is the dvd library folder located ?…

    Unknown

    April 4, 2008 at 9:14 am

  10. Nice guide! I have always wonderd how to get coverart for recordings.

    Peter Byström

    August 7, 2008 at 11:19 am

  11. Nice blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog stand out. Please let me know where you got your design. Bless you ecadedaebeee

    Johng370

    July 13, 2014 at 8:59 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: