Monday, June 29, 2009

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…

Read More...

Sunday, June 28, 2009

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\1280x536\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 1280x536 it expands it to 1280x704.  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.

Read More...

Saturday, June 27, 2009

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.

Read More...

Friday, June 26, 2009

My Encoding Quest Update 2.5

Just wanted to write a quick post because I was sooo excited.  I finally fixed the Mencoder problem that I posted about in My Encoding Quest Update 2.  So far I have only done a few small tests.  Working on a larger test now and I will post the results later with the solution.

FINALLY!!!!

Read More...

Wednesday, June 24, 2009

How I Get My DVDs Into Media Center

I have had a few questions about ripping DVD’s and the best format to use.  The answer to that question really depends on what you want as the end product.  For me, I wanted a copy of the movie that had the same visual and audio quality as if I were watching the movie directly from the DVD.  Also I wanted a process that was quick and easy.  The one drawback of my process is that it produces rather large files (about 4GB on average) because I do not re-encode the movie.  So with that caveat out of the way here is how I get one of my DVD’s into Media Center and my MediaBrowser library.

1) Rip the DVD with DVD Shrink 3.2

First I insert the DVD into my DVD drive.  Then I open DVD Shrink 3.2 and press the Open Disc button in the upper left.  The resulting dialog box already has my DVD Drive highlighted so I press “OK”.

DVDShrink 01

DVD Shrink then proceeds to analyze the DVD…

DVDShrink 02

… and the result looks like this:

DVDShrink 03

I only want the movie with the AC3 Dolby Digital audio track and nothing else so I choose the “Re-Author” option by pressing the button on the toolbar.  You then get the following screen with the main pieces separated out.

DVDShrink 04

Next just drag “Title 1” under main movie over to the left under DVD in the DVD Structure section.  To verify that you actually have the movie you can highlight Title 1 in the DVD Structure section and press the blue play button above the black box.  You should see something like this:

DVDShrink 05

Next click on the Compression Settings tab.  Here we can deselect all the audio and subtitle tracks that we do not want.  This avoids the end product having audio in a different language and also reduces file size by not keeping audio tracks that you do not need.  You should only have the AC3 5.1-ch English audio track selected like so:

DVDShrink 06

Before you actually kick of the DVD ripping process double check your settings under “Edit > Preferences”.  On the first tab you should have DVD-9 selected in the target DVD size drop down box and uncheck “Split VOB files into 1GB chunks” under the Output Files tab.

DVDShrink 07a DVDShrink 07b

Next click on the “Backup!” button in the toolbar.  Change your backup target to “Hard Disk Folder”, select an output folder (click on the folder icon for a suggestion) and uncheck the “Create VIDEO_TS and AUDIO_TS subfolders” option.  Then press OK and the Encoding dialog box will pop up.

DVDShrink 08 DVDShrink 09

Wait for the encoding to be done and the DVD is ripped to a single VOB with full DVD video quality and the AC3 5.1-ch sound.  You are done wit DVD Shrink.  The encoding time will depending on the hardware you are using and the system resources available at the time.  I was actually recording an HD show at the same time as ripping the DVD for this post.

2) Convert VOB to DVR-MS with VideoRedo

I chose early on in my Media Center journey to try and work with the native file formats as much as possible and bypass any on the fly transcoding.  The main reasons for this were ease of use for the family and consistency of experience (i.e. all my video files have the same FW/RW experience regardless if it’s ripped or recorded TV).

I use VideoRedo for the last step but I am sure there are other options.  This to me was the easiest.  Open VideoRedo and open the VOB file.

Then under the “Tools” menu choose “Quickstream Fix…”.  Change the “Output Stream” option to reflect the final directory and filename of the movie file.  In this case I want to put it in the movie folder of my home server so the “Output Stream” value is “\\server_name\movies\Memento\Memento.dvr-ms”.  Click on “Start Quick Fix”.  About 5-8 minutes later you are done.

VideoRedo 02

VideoRedo 03

3) Open up MediaBrowser and verify

Last thing I do is open up MediaBrowser and verify that the new movie was scanned and picked up.

MediaBrowser 01MediaBrowser 02

If you see any issues with the meta data that was automatically pulled by MediaBrowser you can use MetaBrowser to make corrections.

That’s it!  Any questions just shoot me an email or leave a comment.

Read More...

Thursday, June 18, 2009

My Encoding Quest Update 2

I thought I had everything working and sorted out.  The process I had settled on was not as automated as it could be but it was manageable.  Well I have hit a snag and I have absolutely no idea what to do.

The problem is with MKV files for movies that have an aspect ration of 2.35:1.  If the movie is 720p then it most likely has a resolution of 1280x536.  He is a screen shot of “The International”:

International Capture 1 Here is the codec information screen:

International Capture 1 Codec InfoNow for some reason when I use my Mencoder process to convert the file to MPG2 so that I can put it into a DVR-MS container I get a file with the right resolution but incorrect aspect ratio.  The movie looks like this:

International Capture 2 You can visually see that Clive Owen’s head is squeezed up.  On my 16x9 television this movie should still show with black bars at the top and bottom since it has an aspect ratio of 2.35:1.  Instead it now has an aspect ratio of 1.85:1 and fills the screen in this stretched manner.  The codec info in VLC was blank so here it is from VideoReDo:

International Capture 2 Codec Info Everything looks to be in order so I am not sure what is wrong.  Here is the Mencoder command string that was used for the conversion.  If anyone sees anything that might help, PLEASE let me know.

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\1280x536\The International.mkv"

Read More...

Wednesday, June 10, 2009

Shoutout on EngadgetHD Podcast

Big thanks to my friend Dana (dmccall, or as Steve Kim likes to say D.M.C.-ALL) for the shoutout at the end of the this weeks EngadgetHD podcast.

Hopefully there are some new readers to the blog that will subscribe to the RSS feed.  I have a number of posts in the hopper that should be coming in the next few weeks such as “Moving to Media Center: 1 Year Later”, “Windows 7 Features You May Not Know About” and “Organizing a Movie Collection That Just Works”.

The current schedule has me posting at least twice a week so make sure to subscribe and keep coming back.

- Andres

Read More...

Tuesday, June 9, 2009

My Encoding Quest Update

Well it looks like fellow Media Center enthusiast Ben Drawbaugh is on the same page as me. He is taking his earlier MKV conversion process that was very TV centric and updating to take into account the extra complexities of movies (multiple aspect ratios and DTS sound).

In lead up to posting his final solution he has given me a piece that will tide me over. Ben has posted an update for DVRMS toolbox that will take an MKV file with DTS sound and convert the audio to AC3 without tampering with the video stream.

Now my little "MencoderProper" app that I wrote in C# works great. It will create the proper Mencoder application string and convert the MKV file to MPEG2 which allows me to get the file to MKV.

I was going to continue to clean up the app, but now that I know Ben is working on getting something going as part of DVRMS Toolbox I think I have a stop gap solution that is good for now.

The best part of this endeavor was that I learned more about C# development and I am seriously thinking about working on a Media Center plugin.

Read More...