On the Path to the Ultimate Media Center Media Library (Part 1)

Introduction

For the past few months, I’ve been working on and off with the Media Browser team to help create the ultimate media library solution for Media Center. I’ve come to realize that Media Browser’s folder based system has some major drawbacks and I’ve been unable to convince the team to switch to a better storage system. So I’ve decided to completely rethink the idea of a “Media Library” and build my own solution.

The Problem

The real problem is that there isn’t a standard movie file format or television file format. Most, if not all, of the Media Center plugins, and the Windows 7 Movie Library, require each movie to be in its own folder. Additional files such as backgrounds or cover art are also generally placed in these folders. Metadata for movies is provided by the de facto standard “My Movies” XML file, a “dvdinfo.xml” file or an entry in a database. Metadata for television episodes isn’t standardized and varies from application to application.

Forcing each movie or television show season to be in a folder adds an extra level of complexity to library management. No other type of digital entity (photos, documents, etc) requires a unique folder. Even an entire music collection could exist in a single folder, the embedded metadata dictates how the player application will organize for presentation to the user.

All modern video containers support metadata, however the level of metadata support varies:

  • AVI supports almost no useful metadata.
  • WMV supports more metadata but not quite enough.
  • DVR-MS/WTV support fairly extensive metadata but is missing a few critical items like “Season Number”. (It may be possible to add additional custom metadata to this container. Must investigate further.)
  • MP4 supports a weird collection of metadata, seems to have an emphasis on music, does support “Season Number” and “Episode Number” but is missing stuff like “Directors”, “Actors”, “Crew”, etc.
  • MKV supports almost no default metadata but has an extensible tag based system that can be customized on a per-file basis. Also supports Chapters.

The Matroska Hydra

Of all the relevant container formats, Matroska seems to be the most popular and already supports embedded metadata via “tags”. Matroska also has the advantage of supporting “attachments”. Currently these attachments are mostly used for subtitle fonts but there’s nothing stopping us from using them for cover art or background images.

However, Matroska isn’t perfect as there still isn’t full support in Windows. The filters/splitters that are available only implement the minimal features to make the files playable.

Currently missing from Haali’s implementation:

  • Fast forward and rewind
  • Subtitles require VSFilter
  • Subtitles disable DXVA
  • Subtitles, audio tracks and chapters aren’t switchable from Media Center
  • x64 version not officially supported / hard to find
  • Property Handler for Windows Explorer / Desktop Search

Currently missing from DivX Lab’s implementation:

  • Chapter switching
  • Subtitles
  • Audio track switching
  • Property Handler doesn’t fetch metadata, only runtime

I have not tested Gabest’s splitter but I’m going to assume it has fewer features than either Haali or DivX Labs as it is much older and I believe it to be no longer being developed.

The Long Road Ahead

Before we can even begin to embrace Matroska as the ultimate container format for movies and television, we need to implement some lower level services.

  • IFilter so Windows Desktop Search can index metadata
  • Property Handlers so Windows Explorer can display properties (and maybe edit)
  • Libraries to obtain and add metadata to existing Matrosta files
  • Libraries to remux other containers into Matroska files

After creating these base items, we can do some really cool stuff like create a “Movie Library” using Windows 7’s Libraries feature. This would allow searching for more than just filenames from Windows Desktop Search. For example, I could search for “Bruce Campbell” and get a list of all movies I have starring Bruce. Property Handlers should also allow us to extract attachments from a Matroska file allowing us to use cover art as icons instead of thumbnails generated from a frame of the movie. The Media Center plugin would no longer need a database since Windows Desktop Search effectively becomes the database.

Conclusion

The remaining blog posts in this series will chronicle the research and development I’m doing while creating this “Ultimate Media Library”. The pace of the work I’ve done up to this point has been very slow so I would expect the frequency of posts in this series to be anything but frequent. I plan for the entire project to be open source however there’s nothing worth posting yet. If anyone has any ideas or would like to get involved, feel free to get in touch with me on Twitter or via this site or whatever.