Latest in Bittorrent

Image credit:

How to automatically download and import HD to Windows Media Center

Ben Drawbaugh

We don't try to hide how much we like Windows Media Center around here but that doesn't mean we hesitate to complain when warranted, and one of our biggest complaints has always been the limited codec support -- especially when it comes to Extenders. Well we're happy to say that we've found an acceptable work around, one that does require a little initial let work, but after that it is all automatic. The process is actually simple and in the end you'll have a hard time being able to tell which shows were recorded with Windows Media Center, and which were downloaded -- and of course they're in HD. The bad news is that the legality of downloading HD from the internet isn't exactly crystal clear, but if you aren't scared of BitTorrent and you're looking for a way to fill in the gab left by the HD channels your provider doesn't offer, then click on through.

How it works

We're going to start with a quick overview of how the process works. First we set our favorite BitTorrent program to automatically download our favorite shows using the magic of RSS. Then we query for the metadata for the recording which includes things like the original air time, the description and the genre. Finally we use DVRMSToolBox to automatically process the x.264 MKV file (also works with Xvid), converting them to MPEG-2 while at the same time retaining the Dolby Digital Surround sound. And finally, it wraps the audio and video into a new DVR-MS file in the Recorded TV folder -- since Windows 7 support h.264 we won't have to re-encode, and yes we've already gotten it to work.

Make sure you check with your local, state and country's laws -- In some cases you may be inadvertently downloading (and uploading) copyrighted material.

What you need
DVRMSToolBox (x64)(The latest version)

Start out by downloading and installing DVRMSToolBox, which for our purposes mostly consists of just clicking next, next, next -- the only non-default we suggest you select is the "Modify file permissions" check box.

Next we install uTorrent, which is also a straight forward install, but will require some setup on your router -- there is plenty of help setting this up online. For this automated process we'll want all of our shows to be moved to our Recorded TV directory when the download is complete. It is important to use the "Move completed downloads to:" setting under Options>Preferences to ensure that DVRMSToolBox doesn't try to process it before it is done downloading.

Out of the box most of the default DVRMSToolbox settings will work, but we need to launch DVRMSToolBoxSettings to add .mkv to the list of "Watched Ext" on the "File Watcher" tab, the line should look like ".dvr-ms,.mpg,.ts,.mkv,.avi" Now hit the "processing tab" and on the "Delay Processing" drop down, select "ignore."

This is all you have to do, but you may also want to edit the profile to use different paths or different encoder settings. To do this you'll launch DVRMStoMPEGSettings and edit "Convert MKV to DVR-MS - mencoder." This is the profile we'll use to process the files that are picked up from the default Recorded TV directory for files, convert them in the DTBTemp folder and then move the new file back to the Recorded TV directory -- it is important to use a temp folder otherwise Media Center will try to import the file before the metadata is inserted. You may also want to automatically deleted the original downloaded file as by default we just try to move it to the DTB Output folder, assuming it is done seeding.

Now we need to setup a Process Conditioner so that our files are processed automatically. To do this launch the "ProcessContionEditor" included with DVRMSToolBox.
Hit the "New Condition" button and create a Process conditioner called "Convert mkv to dvr-ms"
Select the "Convert MKV to DVR-MS - mencoder" profile from the dropdown.
On the right click "Add" .
And then on the first drop down choose "FileExt"
The second drop down should be "Equal" and put ".mkv" in the text box.

Repeat for AVI, but choose "Convert AVI to DVR-MS - mencoder" instead.
Click "Save" and use the "Raise Priority" button on the right to move it to the top.
Finally you want to edit the other two conditions to eliminate the possibility that they incorrectly run on the imported files. You can do this by adding a FileExt requirement of .dvr-ms to "Every file" condition and a Equal to ChannelNumber 0 on the "Processed file" condition.

Now that everything is setup it's time to find something to watch. Just like the setup adding a new series to download is a manual process, but after that, it all happens automagically. Start by navigating to tvRSS's search page. There is some trial and error here, but basically you build a query until you get the shows you want to download to show up. So for our test we put "Fringe" for the Show Name and "720P|HDTV" in the Quality box -- because you know we aren't down with SD. Once the results look right and there aren't any duplicates, right click on "Search-based RSS Feed" and copy the link address.

Now launch uTorrent and click on the RSS button (or you can hit File, "Add RSS Feed"). The link in the clipboard should already be there, so just click on the "Custom Alias" check box and put the show name and then select the "Automatically download items published in feed" radio button. Now as soon as a new episode is posted it'll automatically be downloaded -- if you don't want all the older episodes, now is the time to stop them from downloading.

Now once the shows are done downloading, it'll be moved to the Recorded TV folder where DVRMSToolBox picks it up, works its magic, and moves it back (the original files are moved to the DTB output folder, but can easily be deleted by editing the profile). Then the next time you browse through your Recorded TV shows you'll see the program complete with metadata with the rest of your shows -- right where they belong.

So if you got everything all setup and it still doesn't work, check out the Filewatcher log file at C:\Users\Public\DvrmsToolbox\DVRMSFileWatcher.log. If the FileWatcher Service is seeing the new files and attempting to process them, you'll see a line like this in the log.
FW Begin Process E:\ToConverttoRecordedTV\Fringe.S01E11.720p.HDTV.x264-CTU.mkv
If you see this line, but still no joy, then check out the log for the particular file at: C:\Users\Public\DvrmsToolbox\FWLogs\Fringe.S01E11.720p.HDTV.x264-CTU.log.
Go towards the end and look for an error, but sometimes the errors will be further up, in that case it'll take a little more time to find it.
If you don't see a line like that in your FileWatcher log, then you need to check your File Watcher settings or Process conditioner, you can also try restarting the "DVRMSFileWatcherService" in Computer Manager.

If TheTVDB action fails to find the show, you'll see an error like "Unable to find Episode in TvDB Database" in the file's log, which will be in the FWLog directory. This could either mean the show isn't in the DB or the name is different then the file name. Do a manual search on and look for the show. If the names are different, edit C:\Program Files\DVRMSToolbox\SeriesAlias.xml accordingly (there are a few examples in there already). The action expects the file to be named like our examples, but if you are up to it you can edit the regex in the profile's action to accommodate your naming convention.

If you are having problems where the query to TheTVDB fails because it can't find the season or episode number, edit the "Read metadata from TVDB and build Sage XML File" action in the appropriate profile and change the Extraction Regex to (?<series>.+)\.[s,S](?<season>\d+)[e,E](?<episodenbr>\d+)\. (make sure to include the last period at the end). Thanks Featherking for the tip! I'll be sure to have Andy update this in the next release.

A special thanks!
Although we spent a lot of time making this happen, the real work was done by two very talented programmers. DVRMSToolBox is by Andrew Van Til, and is an old favorite that many think is just a commercial skipping application. In reality it can do so much more including convert just about any type of video, to any other format and supports custom actions such as the one were using here to query's metadata. As for the custom action, it was written by our good friend Warren Wiltshire of Seagull Consulting -- yes it's named that for the reason you're thinking. Without these two great programmers this wouldn't be possible and we can't speak for anyone else, but we really appreciate it.

From around the web

ear iconeye icontext filevr