Log in

View Full Version : Correcting aspect ratio during encode


DRP535
27th November 2006, 14:18
I'm wanting to convert an MPEG-1 video file to AVI using AutoGK. Unfortunately the MPEG has been encoded with the wrong aspect ratio. It displays at 376x288 pixels which is ~1.3:1. The correct aspect ratio is 3:2. I have corrected it as much as possible using MPEG Sequence Maker, but the closest I can get with that software is ~1.46:1.

Using that corrected 1.46:1 AR MPEG as the input source for AutoGK doesn't work though because even when I force a fixed width of 432 using advanced options, the height is calculated off that to get as close to the input's 1.46:1 ratio as it can. The end result is an AVI with a height of 304. What I want is an AVI with width of 432 & height of 288. Is there any way I can force both width & height in AutoGK to get the slight correction in output aspect ratio I need?

Here's the AviSynth script the encode I did created. Can I manually edit this somehow to force a height of 288 and restart the encode somehow? Everything else about the encode is perfect. I just need to be able to force the overall dimensions to my requirements.

LoadPlugin("C:\PROGRA~1\AutoGK\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\autocrop.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\RemoveGrainSSE2.dll")

movie = mpeg2source("C:\Documents and Settings\Temp\agk_tmp\Burnout of Hellas.d2v")
cropclip = autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=0,threshold=0,samplestartframe=0,leftadd=1,rightadd=0,topadd=0,bottomadd=0)
fixed_aspect = 1.11919418019026
c_width = width(cropclip)
c_height = round(height(cropclip) / fixed_aspect)
input_par = float(c_width)/float(c_height)
out_width = 432
out_height = round(float(out_width) / input_par)
hmod = out_height - (floor(out_height / 16 ) * 16)
out_height = (hmod > 4) ? (out_height + (16 - hmod)) : (out_height - hmod)
new_aspect = (float(out_width) / float(out_height)) / fixed_aspect
autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=new_aspect,threshold=0,samplestartframe=0,leftadd=1,rightadd=0,topadd=0,bottomadd=0)
LanczosResize(out_width,out_height)
RemoveGrain(mode=2)

CWR03
27th November 2006, 20:57
Under hidden options (Ctrl + F9) you can check and set to maintain 4:3, 16:9 or original resolutions.

DRP535
27th November 2006, 22:46
Yeah I've seen that, unfortunately none of the options given are what I need. The video is 3:2 but gets recognised by AutoGK as 1.46:1 which in this case isn't close enough. There are lots of perfectly round objects in the video, so being slightly off in the aspect ratio is easily noticeable.

I'm not sure what the "Original" option is supposed to do. It doesn't make sense to me. Obviously 4:3 & 16:9 are both wrong. What I need here is a dialog box where I can enter 3:2 because the input MPEG is set at ~1.46:1 with no way of correcting it to 3:2 without re-encoding which is something I'd like to avoid if at all possible.

BigDid
27th November 2006, 23:35
Yeah I've seen that, unfortunately none of the options given are what I need. The video is 3:2 but gets recognised by AutoGK as 1.46:1 ...
I'm not sure what the "Original" option is supposed to do...
Hi,

Have you tried:
1/Hidden options (Ctrl/F9)
- uncheck "detect and force 4:3..."
- check "Override input aspect" AND "Original"
2/Click Preview to get the encode aspect ratio

What is the result?

If good, you can use fixed width in the advanced settings to get your 432 width.

Did

Did