• Categories

  • Archive of Posts

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.

Advertisements

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 )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: