Log in

View Full Version : MeGUI Noob Aspect Ratio Question.


LordTrace
15th April 2012, 14:27
Hello :)

I am trying to encode a few TV series from DVD to x264/AAC with MeGUI. At first i was autocropping then using a resolution of 640x480. I got about 10 eps in on the first series when i noticed that, after cropping, MeGUI was just stretching the image to fill what was cropped out. Making the image slightly wider. So i decided to try an anamorphic encode. I got it to were its properly cropping and not filling the cropped portion. Double check with AvsP....

http://screenshotcomparison.com/comparison/118972

.. I encode an episode. Everything seems great. Double check by saving images with media player classic...

http://screenshotcomparison.com/comparison/119071

... BUT, when i play both the vob and the encoded mp4, comparing them side by side. It seems like the encoded file is being displayed slightly wider then the vob. Exactly the same as my 640x480 rips.

http://screenshotcomparison.com/comparison/119094

Any ideas? lol. I have tryed both ITU and "normal". Normal makes it to tall.

My avs for the encode in the second set of screens.
# Set DAR in encoder to 4 : 3. The following line is for automatic signalling
global MeGUI_darx = 4
global MeGUI_dary = 3
LoadPlugin("D:\Programs\MeGUI\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("E:\Ripping\VTS_04_1.d2v", info=3)
LoadPlugin("D:\Programs\MeGUI\tools\avisynth_plugin\ColorMatrix.dll")
ColorMatrix(hints=true, interlaced=true, threads=0)
LoadPlugin("D:\Programs\MeGUI\tools\avisynth_plugin\checkmate.dll")
Checkmate()
LoadPlugin("D:\Programs\MeGUI\tools\avisynth_plugin\Decomb.dll")
AssumeTFF().Telecide(guide=1).Decimate()
LoadPlugin("D:\Programs\MeGUI\tools\avisynth_plugin\RemoveGrainSSE3.dll")
RemoveGrain(mode=18)
crop( 8, 0, -4, 0)

BicubicResize(704,480,0,0.5) # Bicubic (Neutral)
LoadPlugin("D:\Programs\MeGUI\tools\avisynth_plugin\MSharpen.dll")
MSharpen(threshold=10,strength=50)

LordTrace
16th April 2012, 03:02
I the vobs through AutoGK just to see what happens. Looks like it zooms a little bit instead of stretching. Preserving the AR. Am i doing something wrong or does MeGUI just like stretching hehe :(

http://screenshotcomparison.com/comparison/119201

hello_hello
17th April 2012, 01:10
If you're using anamorphic encoding, go into MeGUI's options and change the "Acceptable Aspect Error" option to 0% (it only effects anamorphic encoding). I think it's set to 2% by default. I assume the idea behind having it at 2% allows you to crop a little while still achieving nice 4:3 and 16:9 aspect ratios, but as a result it might stretch the picture a little. If it was up to me it'd be set to 0% by default, but anyway....

If you use non-ITU resizing the aspect ratio set by MeGUI should be 4:3 before you crop. As soon as you crop anything, the aspect ratio written to the script should change accordingly, however you've cropped 12 pixels and the aspect ratio is still 4:3, so I assume it's because of the "acceptable aspect error" option. With it set to 0%, after cropping 12 pixels from the sides I think the aspect ratio set by MeGUI should be 59:45 and the resulting picture won't be stretched (non-ITU). However......

It also won't have a nice 4:3 aspect ratio. If you care about that but don't want the picture stretched either, you'll need to also crop 4 pixels from both the top and bottom (non-ITU resizing), which should get the aspect ratio back to 4:3. With the "Acceptable Aspect Error" set to 0%, the aspect ratio MeGUI writes to the script should change every time you crop.

For non-anamorphic encoding:
AutoGK appears to have cropped a few pixels from the top and bottom, hence the effect of "zooming", but as a result the picture aspect ratio hasn't been changed. When using non-anamorphic encoding with MeGUI it doesn't auto-crop "cleverly" as AutoGK does. Like most other encoder GUIs, it crops the video then squishes it into the nearest mod16 dimensions, which can fudge the aspect ratio a little. In order to stop this from happening, you sometimes need to crop a little extra of the picture manually when resizing (as AutoGK did). In order to work out the right cropping for minimum aspect ratio distortion, I use the Yoda Resize Calculator (http://www.mediafire.com/?09v9bldu9a6hm00) (note: the result will be different depending on whether you have ITU resizing checked or not). Basically you'd use MeGUI to work out what cropping needs to be done to remove the crud, then put those figures into the resize calculator, set the output size, and adjust the cropping until the aspect ratio distortion is as low as you can get it. Sometimes you need to play with both the cropping and the output dimensions until the aspect ratio distortion is at a minimum. When using MeGUI you don't need to use the calculator for anamorphic encoding.

For the record.... I'm fairly sure MPC-HC (and all other software players) use non-ITU resizing when displaying DVDs, so you can only compare the encode apsect ratio with the original using MPC-HC if you use non-ITU resizing when encoding. I pretty much always use non-ITU resizing anyway. AutoGK uses non-ITU resizing by default (there's a hidden option to change it) while I think MeGUI defaults to ITU resizing. Fortunately, recent versions of MeGUI have a "Use ITU Aspect Ratio" option in Settings which you can uncheck.

LordTrace
17th April 2012, 01:55
Thanks for the great reply. Makes sense! hehe

I tried running the AutoGK avs in MeGui and it worked great. Maybe i'll try to add autocrop to my avs creator profile.

hello_hello
17th April 2012, 02:43
I tried running the AutoGK avs in MeGui and it worked great. Maybe i'll try to add autocrop to my avs creator profile.

Yeah, originally I thought of trying to duplicate the AutoGK scripts in MeGUI myself, although if you have AutoGK's "detect and force 4:3 aspect ratio" option checked it'll be a different resizing script for 4:3 than 16:9.

In the end though I didn't bother as when I'm converting to Xvid/AVI I still just use AutoGK anyway, and if I'm converting to x264/MKV I generally use anamorphic encoding in which case I don't think AutoGK's scripts would work.
On the odd occasion I convert DVDs to square pixels using MeGUI it's easy enough just to use the resize calculator. Plus I prefer to crop manually anyway as AutoCrop doesn't always crop as cleanly as I'd like.

LordTrace
17th April 2012, 10:56
Thanks for your help bud. Got everything working nicely now :)