Wednesday, July 28, 2010

Windows 7 MCE + HD-PVR + transcode = Neverending frustration

Recently, I decided to make some upgrades to my HTPC portfolio, and as always with these things, the experience has been painful. The story always goes about the same with these things: if you want to do something slightly out of the predetermined storyline, your're simply fucked and SOL.

I got myself a shiny new HD-PVR from Hauppauge. The device is an HD capture device that relies on the component video outputs of whatever you wish to capture. it captures video as AVHCD (H.264) and audio as AC3. I'm using it at the moment as a supplement to my TV company's DVR because the damn thing has a tiny drive (120G) in relative terms for HD content, which is all I care about.

The device does the trick as advertised, but when you want to make it work under the umbrella of Windows Media Center, there are a few hoops you need to jump through. There's a beta set of drivers on the Hauppauge website that works fine for me. My one major issue with it is that the resulting file (1080 with AC3) seems to be a little too much for my HTPC to handle (although it's supposed to have enough video ans CPU horsepower to support blu-ray video, but I digress), and I would love to rescale the captured file down to 720p. This is where my deviation from the norm happens, and this is where I get severely punished for it...

When the HD-PVR is connected to MCE, the captured files are saved in the MS-only wtv container format. This container format along with the video codec makes working with the recorded files almost impossible. Most of the usual suspects (Handbrake, Avisynth, Avidemux) do not understand that container type. There's another ms format, but the conversion is only permitted when the recording compression is MPEG2. Since the HD-PVR does not record in MPEG2, I cannot convert to the other, friendlier format...

lots of googling and forum reads pointed to some alternatives: Microsoft Live movie maker and Expression encoder.

Live Movie Maker is a pretty simple app to use, but the default encoding profiles are very limited. The latest beta version from Live wave 4 allows you to define your own profiles, which is very nice. However, the application only allows the use of the windows media codec 9, which means only stereo sound, and only WMV files. Another thing that turns people off is the fact that the installation drags some other components of the windows Live bundle that honestly have nothing to do with the movie maker.
I gave it a try anyways, but the deal killer was sound severely lagging the video. Scratch that one...

I read on some AVS forums that Expression encoder supports the container and the compression format, and the commercial version ($50) allows you to save as mp4, and it also supports windows media audio codec pro 10, which can save 5.1 and 7.1 audio. I downloaded the free version 4 and gave it a try. The UI is very polished and it allows a little more editing control than Movie Maker.

The problem with Expression encoder 4 is that the source video can be loaded, and encoded, but the source video does not show on the preview window. This makes any kind of editing impossible. The closest thing one can do is to play the original, note the cut points by hand, and enter them in the clips property window. If you've ever done any kind of video editing, you know this is a futile exercise. one of my encoding attempts using 5.1 produced a file that had no sound when I played it back on my PC. The media property window showed the Windows Media 5.1 as I expected, but I got nothing. I didn't bother to check it on the MCE system because my PC is has a 5.1 setup, and the original plays correctly.

More googling and forum reads yielded some other options:

A) 3 steps,
  1. Dump the video and audio streams using GraphStudio.
  2. Put them back together (MUX) using TsMuxer as a transport stream (.ts) file
  3. Transcode using handbrake or some other editor that understands .ts files.

As kludgey as this sounds, it is remarkably simple. It requires some level of understanding most people don't have, but could easily acquire. I'll post a recipe for this later.

This yields a file with all the right things in it. Handbrake is more than happy to process the file. This is, however, a 3-step process, and does not allow for any video cuts other than at the beginning and end.

B) Install a media splitter that understands .ts files, so Expression Encoder can load the file. for this, I used the haali media splitter and the AC3 filter for the audio decoding. I also installed ffdshow, but I thing you can skip that step.

Remember how I mentioned earlier that Expression Encoder does not show the video preview when working with the .wtv file? It it more than happy to show it to me using this method! That is one of the more frustrating aspects of this endeavor. The video and audio are identical to the .wtv file, but they're inside a different container. That's it! how come the MS container does not work in an MS product???? Shenanigans!!!!

This approach worked exactly once for me. Every subsequent attempt always ends the same way: the job fails after a little while. I now cannot seek through the imported video without locking up Expression Encoder. I probably made the fatal sin of uninstalling the software and re-installing it... These codecs are so sensitive that one false move, and you're fucked... :(

So for now, my only available compromise is option A, and living with the uncut original. Cutting out commercials is really not that big of a deal for me because I'm not really interested in archiving the recordings. The main motivation for me was saving space.

I also heard of Format Factory. I will give it a shot and update.

Do you know of any .ts or .wtv editors that understand the HD-PVR format and don't cost an arm and a leg? If you've read this far, you know I'm not shy to try something free that's not too convoluted :)

Later,

No comments: