Like a lot of Windows geeks and fanboys, I use Windows Media Center on a Windows 7 system as my Digital Video Recorder (DVR) and media library. My system consists of a Dell GX270 computer with a ZOTAC NVIDIA GeForce GT610 video card, and it uses an InfiniTV 6 ETH tuner to receive cable signals. This setup has served us faithfully for years, and it is the center piece of our home entertainment system. If you're not familiar with Windows Media Center, that's because it's a rather hideously under-advertised feature of Windows. Just the same, here is an official Microsoft teaser for it:
But I've done a few extra things with my Windows Media Center that are a little beyond the norm, and one of the biggest items that I spent a considerable amount of time and effort digitizing my entire collection of DVD and Blu-ray discs as MP4 files, and I store them on a Thecus NAS that's on my home network which I use for media libraries on my Windows Media Center. This allows me to have all of my movies available at all times, and I can categorize them into folders which show up under the "Videos" link on the Windows Media Center menu.
That being said, there's a cool trick that I've been using to help customize some of my movies. Some of the movies that I have encoded have some material that I'd like to cut out, (like excessive opening credits and lengthy intermissions), but I don't want to edit and re-encode each MP4 file. Fortunately, Windows Media Center supports Advanced Stream Redirector (ASX) files, which allows me to customize what parts of a video are seen without having to edit the actual video.
Here's a perfect example: I recently purchased the 50th Anniversary Collector's Edition of Lawrence of Arabia on Blu-ray. The film is one of my favorites, and this reissue on Blu-ray is phenomenal. That being said, the movie begins with a little over four minutes of a blank screen while the musical overture plays. In addition, there is an additional eight minutes of a blank screen while the music for intermission is played. This is obviously less than desirable, so I created an ASX file which skips the opening overture and intermission.
By way of explanation, ASX files are XML files which define a playlist for media types, which can be any supported audio or video media. The individual entries can define various metadata about each media file, and thankfully can be used to specify which parts of a media file will be played.
With that in mind, here's what the ASX file that I created for Lawrence of Arabia looks like:
<ASX VERSION="3.0">
<!-- Define the title for the movie. -->
<TITLE>Lawrence Of Arabia</TITLE>
<!-- Specify the movie's author. -->
<AUTHOR>Columbia Pictures</AUTHOR>
<!-- List the copyright for the movie. -->
<COPYRIGHT>1962 Horizon Pictures (GB)</COPYRIGHT>
<ENTRY>
<!-- Define the video file for this entry. -->
<REF HREF="Lawrence Of Arabia.mp4" />
<!-- Define the start time for this entry. -->
<STARTTIME VALUE="00:04:17.0"/>
<!-- Define the duration for this entry. -->
<DURATION VALUE="02:15:07.0"/>
</ENTRY>
<ENTRY>
<!-- Define the video file for this entry. -->
<REF HREF="Lawrence Of Arabia.mp4" />
<!-- Define the start time for this entry. -->
<STARTTIME VALUE="02:23:38.0"/>
</ENTRY>
</ASX>
The XML comments explain what each of the lines in the file is configuring, and it should be straight-forward. But I would like to describe a few additional details:
- Individual media entries are obviously defined in a collection of <ENTRY> elements, and in this example I have defined two entries:
- The first entry defines a <STARTTIME> and <DURATION> which skip over the overture and play up to the intermission.
- The second entry defines a <STARTTIME> which starts after the intermission and plays through the end of the movie.
- The other metadata in the file - like the <AUTHOR> and <COPYRIGHT> - is just for me. That information is optional, but I like to include it.
There are several other pieces of metadata which can be configured, and a list of those are defined in the Windows Media Metafile Elements Reference and ASX Elements Reference.