• Categories

  • Archive of Posts

  • Advertisements

My Encoding Quest

common (image) aspect ratio found in video.Image via Wikipedia

Over the past few days I have been on a crazy encoding quest. I use to have a kind of convoluted process of converting MKV movies into DVR-MS files but I was inspired by Ben Drawbaugh’s post on EngadgetHD to simplify the process. The simple thought has turned into a journey that I did not expect.

So first let me explain the old process. After I had the MKV file (fill in the blank) I would do an initial conversion using MKV2VOB. That conversion would give me an MPG file that maintained the same HD video resolution and a 5.1 AC3 audio track. A number of MKV files have DTS audio so the AC3 audio track was very welcome. For some reason this file would not open in VideoRedo so I did another conversion using Transcode360. I would just play the file via Media Center using Transcode360 and the file would be encoded into a proper MPEG2 HD file with AC3 audio. The last step would be to open the file from the Transcode360 cache folder in VideoRedo and perform a quickstream fix to end up with an HD DVR-MS file with 5.1 audio. Whew! Not only is that too many steps but I have also had trouble installing Transcode360 under Windows 7.

After reading Ben’s post about converting MKV’s using DVRMS Toolbox I thought I could just use the same process for my movies. Well, I was wrong. The two sticking points for this working are aspect ratio and audio. The process that Ben layed out was specific to TV shows which all have the same 16:9 (1.78:1) aspect ratio. Movies on the other hand usually have either a 1.85:1 or 2.39:1 aspect ratio. TV shows also have AC3 audio by default while movies could be either AC3 or DTS so the audio track would need to be converted.

As I started to dig deeper I realized that both processes use MEncoder to do all the heavy lifting. The difference was really in the way MEncoder was used. Transcode360 always worked because it analyzed the movie file to make sure apsect ratio was preserved and AC3 audio was used.

My next thought was that I could just reuse the C# code that is part of Transcode360 and create a simple command line program that would use the Transcode360 logic and in the end be used in conjunction with DVRMS Toolbox. I personally do not care for the transcode on the fly functionality as much as I care about getting the movie file in the format that I want and need which in this case is DVR-MS so that I can have a smooth fast-fwd / rewind experience.

I am probably about half way through coding my new C# application and it has been a lot of fun. It has been awhile since I did any coding so it’s nice to get back to it. When the application is complete then you will be able to just run the app at the command line and pass in the path to the file that you want to encode like this: c:\mencoderproper.exe “c:\test.mkv”

The result will be a file named test.mpg with full HD video in the proper resolution with AC3 audio. Once I have this working I can integrated it with DVR-MS and have a process that will watch a TO CONVERT folder. Once a file is place in that folder it will be re-encoded and then converted to a DVR-MS file using todvrms.exe. The resulting file will be moved to the home server and added to the movie collection.

As soon as I have everything working I will post everything for download.

Reblog this post [with Zemanta]

6 Responses

  1. Damn. I wish I could contribute to this project of yours somehow despite my lack of programming abilities. Perhaps even as a beta tester. I basically have the same problem as you do and have been racking my brain the last few weeks trying to come up with a solution that isn't so manual. I have windows 7 and transcode 360. My biggest gripe is not being able to get 5.1 audio to my media extender wihout creating a DVD file structure for the movie first. As you can imagine this eats up a lot of HD space.

  2. Perhaps I can help you get T360 working under windows 7 and you can show me you got it to transcode your mkv files with ac3/dts audio tracks intact?

  3. Marc,

    I slowed down on the project because a solution looks like it's forthcoming in DVRMS Toolbox.

    In the meantime, I can definitely help with getting DVD's onto Media Center. I rip without re-encoding because I want the full quality. It takes up space but a Terabyte is so cheap these days I don't mind.

    Currently my collection of 340 movies is taking up about 1.69 TB on my Windows Home Server. I'll work on a post tonight showing how I rip my DVD's.

  4. Sounds good. Looked into the latest version but I'm not sure what new feature you're referring to. Looking out for your tutorial though. I'm still trying to get mkv files into a dvrms container while retaining ac3 audio. I keep getting 2 channel audio fo some reason.

  5. Marc,

    I have it working and it will hopefully be out soon. Still just a few more bugs. I actually just fixed one 5 minutes ago. Just hang in there.

  6. No rush. 🙂

    I've been working at it this long, what's a little longer, eh?

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: