PDA

View Full Version : "fixed_aspect" and "input_par"in the the avs file...


ukb007
25th October 2004, 03:28
Hi, PROs.

Here's a sample from an .avs file generated by AGK.
----------------------------------------------------------------------
LoadPlugin("D:\PROGRA~1\AutoGK\DGMPGDec\DGDecode.dll")
LoadPlugin("D:\PROGRA~1\AutoGK\filters\autocrop.dll")
LoadPlugin("D:\PROGRA~1\AutoGK\filters\undot.dll")

movie = mpeg2source("F:\Wi\AGKWork\gk_tmp\Wi.d2v")
cropclip = autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=0,threshold=34)
fixed_aspect = 1.18518518518519
c_width = width(cropclip)
c_height = round(height(cropclip) / fixed_aspect)
input_par = float(c_width)/float(c_height)
input_par = input_par > 1.4 ? input_par : (4.0/3.0)
out_width = 608
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=34)
Undot()
LanczosResize(out_width,out_height)
----------------------------------------------------------------------

Please notice Line 8:

fixed_aspect = 1.18518518518519

Can you please tell me more about this? I mean, the numerals aren't the movie AR, that's for sure. What are they?

And in line 12:

input_par = input_par > 1.4 ? input_par : (4.0/3.0)

What do the numerals mean?

A recent tough DVD:

(Not the same one whose avs is copied above)

I recently came across a DVD which played vertically stretched (authored with the wrong AR of 4:3 instead of 16:9). The DGIndex window displayed the picture with much more vertical stretching like this:

IIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIII = the black bar above
IIIIIIIIIIIIIIIIII
OOOOOOOOO
OOOOOOOOO
OOOOOOOOO
OOOOOOOOO = THE PICTURE
OOOOOOOOO
OOOOOOOOO
OOOOOOOOO
IIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIII = the black bar below
IIIIIIIIIIIIIIIIII

It looked, literally, 3:4. The Info window showed it to be 4:3.

Editing the AR figure (from 4:3 to 16:9) in the d2v did not help, I still got a vertically stretched picture in the finished AGK file.

So I changed part of the Line 12 in the avs: (4.0/3.0) to (16.0/9.0) and fed the avs into VDubMod, opting for single pass, and ordering a custom bitrate that was from the AGK-encoded file.

The result was perfect.

I am looking for an explanation; will get it eventually, for sure, but could do with some help. Please.

Regards.

len0x
25th October 2004, 18:46
Not to disappoint you, but you we're very in luck when it worked :)

Line 12 simple fixes AR to perfect 4:3 so that it displays without black bars on a computer monitor (very often, most of the time actually, without ITU resizing you won't get perfect 4:3 on full screen videos). So it simply checks whether source is widescreen or not and corrects it if it looks like 4:3.

ukb007
25th October 2004, 20:00
Sorry, I forgot to mention this, but I had also edited the Line 8 as follows:

fixed_aspect = 2.34518518518519

I did it because the 2.35:1 was the right AR.:cool:

...was that why my luck held ? I'd love to read an explanation of the line 8. Encoding is a mathametical process. Luck should have nothing to do with it!

Additionally, why wasn't editing the d2v effective in the first place?

Regards.

len0x
26th October 2004, 12:11
Tough question - I need to dig into the sources. For sure its only calculated from: AR and resolution from D2V file.