• Categories

  • Archive of Posts

MencoderProper and x64

I was just informed by one of my readers that they were able to get MencoderProper working in an x64 Windows environment.  Reader smcdonald248 wrote:

I Found a solution that allows me to use mencoderproper on my Vista x64 machine. A post on babgvant.com suggested using corflags.exe (a component of the Microsoft .Net SDK) to force mencoderproper.exe to run in x86. Worked like a charm.

Check out the forum over at Andy’s website: http://babgvant.com/forums/p/2785/14615.aspx#14615  If you have success, come back and let me know.  Especially if you get it working under Windows 7.

Thanks for the tip!!

MencoderProper does not like x64

I have been in touch with readers about MencoderProper errors on an x64 version of Windows.  I have started working on a resolution but I have been delayed with a number of personal events.  I am going to try and get it working this week.  So for those that I have been in touch with via email I will start sending test versions and test files tomorrow.  I hope to have this resolved quickly because it has been so nice to have this one-click solution available.

Mencoder Proper – Encoding Quest Over

For the past few weeks I have been posting about “My Encoding Quest”.    The genesis of the posts was my desire to re-encode HD MKV files into native Media Center DVR-MS files while retaining the same video and audio quality.  Well the quest is over and the result is a program that I wrote called MencoderProper.  This post is a history of everything that led to this point while a cross post over on EngadgetHD will show you the best way to use it.

I originally had a multi-step manual process that used Transcode360 and MKV2VOB.  I would convert the MKV to an MPG using MKV2VOB, then play the MPG in Media Center using Transcode360, and  finally converting the Transcode360 cache file to DVR-MS using VideoRedo.  If it sounds complicated its because it is complicated.  At the end of the day though it worked.

After updating to Windows 7 I found that Transcode360 was no longer working and therefore neither was my conversion process.  I had always intended to find a better way of converting my MKV’s and now I finally had the proper motivation.

After doing some research into trying to get Transcode360 to work, I realized that I really did not care for the streaming capability of Transcode360.  I only wanted the encoding portion which Transcode360 offloaded to Mencoder.  The key that made Transcode360 work where other options had failed was that it had programmatic way to determine the best Mencoder command line options for the particular video you were trying to encode.  Luckily for all of us, Transcode360 is open source and the code is available.

So inspiration hit and I thought, “Why don’t I just modify the portion of the code that calls Mencoder for my purposes.”  It was also during this time that Ben Drawbaugh from EngadgetHD posted his tutorial explaining how to get MKV TV shows into Media Center.  I read the instructions and tried to use the same steps for my MKV files instead of going down the longer road of writing my own code.  Unfortunately it did not work and created files with incorrect aspect ratios.

After that failure MencoderProper was born.  I wrote a wrapper application that calls Mencoder properly (hence the name).  Originally it was built to use from the command line but the fates aligned and Ben and I actually started working together and merged both of our projects.  Now MencoderProper is built into and distributed as part of latest release of DVRMS Toolbox (1.2.1.8) and I finally have the 1-click conversion process I have always wanted.  Point DVRMSToolbox at any MKV and it will convert it to DVR-MS at full resolution with the correct aspect ration and perfect AC3 5.1 surround sound.  No problems with extender support and you have full rewind and fast forward capability.

Ben has a post on EngadgetHD with a great “how-to” guide.  Go read it and enjoy what I think is the solution for converting MKV’s for Media Center.  If readers are interested in the details of MencoderProper I will write the post.  Also please provide any feedback or issues that you find in the comments section.  Now that this is finally out I can get back to a regular posting schedule.

Back from vacation…

Well I am back from vacation and getting back to the blog in a big way.

A lot of my time lately has been consumed by my “My Encoding Quest“. All the work I have put is really paying off and the app is working better than I expected. Expect a roll out early next week. If you are an MKV fan and want a simple process for getting MKV’s into Media Center then stay tuned.

I also have a blog post on how I wired my house almost ready and that really got me thinking. How would I do things differently if I had were starting today with the knowledge I have now. So I am putting together a series on that topic that should hopefully help anyone thinking about taking the plunge.

I have a few other series up my sleeve but I want to build up some posts so I can publish on a regular schedule going forward. If you like what you see please pass on the link or the RSS feed.

My Encoding Quest Update 3.5

I was almost done with my last post and ready to release my Mencoder Wrapper application (MencoderProper) when I had a sudden burst of coder’s inspiration.  As I read back over the list of things that were not working it just seemed like I was quitting right before I got to the finish line.  I did a little more research and I am proud to say that I erased all the manual limitations the app had in the last 24 hrs.

MencoderProper can now be used at the command line or via DVR-MS toolbox.  In the last 24 hrs I was able to fix the automatic reading of the video file metadata (to determine resolution, audio type, etc) and fix an issue with an external command window.  With that last one fixed it now successfully runs inside DVR-MS toolbox.

I have sent it out to one person for testing but hopefully it will be something that can get out there soon.   More later…

My Encoding Quest Update 3.0

So I finally have a temporary solution that will work for all my movies.  It’s not ideal but as I said in my previous post I don’t want to do too much because I know something more automated is coming.  At the end of the day it was good C# coding experience that I can use going forward.

So what changed that I now  have a version of the International with an aspect ratio that is actually watchable?  Through the process of elimination I found out it was only one small part of my command line that was incorrect.

I went back to an earlier version of Windows 7 (that I had on my laptop) and installed Transcode360.  I ran Transcode360 in console mode on a sample file so I could see the command string that was being used.  I then took that and compared it to the command string my program was spitting out. 

There were two small differences between the command strings and one of them in particular just did not make sense and stood out like a sore thumb.  As a reminder here is the original command line:

C:\Test\MEncoderTranscoder\mencoder.exe -quiet -oac copy -aid 0 -of mpeg -mpegopts format=dvd -o "C:\Test\The International.360" -lavdopts threads=4 -ovc lavc -vf scale=1280:536,expand=1280:528,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=8000:keyint=15:aspect=16/9:threads=4 -ofps 24000/1001 -sid 0 "C:\Temp\Complete\Movies\1280×536\The International.mkv"

I had the “threads=4” option in the command line twice and I do not think the second one makes any sense at all being where it is.

The real problem was with the expand option (expand=1280:528).  This is where the magic happens.  The code that I used from Transcode360 has a crucial method that calculates the optimal resolution.  Unfortunately I had had height and width hardcoded for testing purposes and I did not realize it until today.  Now that I have fixed that the code calculates the optimal expand resolution.  So for movies with a resolution of 1280×536 it expands it to 1280×704.  I don’t know why this works but it does.  And right now that is all that matters.

I will post the small app that I have created in case anyone is interested in a separate post so I can explain it’s idiosyncrasies.

My Encoding Quest Update 2.7

I am out of town right now but I wanted to give one more update before the full post tomorrow.

I just finished encoding a 108p MKV with DTS sound into a DVR-MS 1080p file with AC3.  It took one pass to get the mkv to mpeg2 and then from that point it was a matter of putting the mpeg2 into the DVR-MS container.

I can finally get through a backlog of movies and get them encoded with the proper aspect ratio.  I have noticed one issue though.  MediaBrowser is reading the video MetaData incorrectly.  Annoying but not a deal breaker by a long shot.