Log in

View Full Version : Aspect Ratio Math


sumawo13
29th October 2009, 00:49
I've looked and looked for reading material on doing aspect ratio conversions but I haven't had any luck.

Where do I go to read about the math programs like FitCD use to do their calculations?

sekininsha
29th October 2009, 00:54
something here

http://www.doom9.org/aspectratios.htm

http://www.doom9.org/mpg/avistretching.htm

Seraphic-
29th October 2009, 01:00
Use the height of your video, so for example:

480 multiplied by 16 divided by 9 equals 853
or
480 multiplied by 4 divided by 3 equals 640

Revgen
29th October 2009, 05:06
simple math.

Let's say you want to find x:

4 1920
3 x

Muliply the crossed values (1920x3) and you get 5760. Once you have the number resulting from the 2 crossed values, you then divide 5760 by the remaining number (4) and you get 1440. So the 1920/x aspect ratio equivilent to 4/3 is 1920/1440. Basically you do 1920x3 / 4 = 1440.

MatLz
29th October 2009, 06:51
Hi! I agree...after coffee, calc.exe is the best friend of human being....;)

To be serious take a look at my attachment. Unfortunetely I can't remenber where I got it, so sorry for the author, I can't write her/his name.
It's a simple tool and maybe it will help you.

MadRat
29th October 2009, 09:18
Good thing Revgen is here to help, I've always used AvsP or YATTA.

hanfrunz
29th October 2009, 10:41
for further reading:
http://lipas.uwasa.fi/~f76998/video/conversion

and a calculator by smok3
http://resizecalc.somestuff.org/
and http://forum.doom9.org/showthread.php?t=133557

Gavino
29th October 2009, 10:57
Also, remember when doing AR calculations in Avisynth that any divisions must be done using floats, not ints. This is a frequent trap for the unwary.

Thus, for a 640x480 clip,
AR = width()/height()
gives AR = 1 instead of 1.333... (integer division truncates to give an integer result)
You need to use
AR = float(width())/float(height())
or, if lazy (since only one of the operands needs to be a float)
AR = float(width())/height()

2Bdecided
29th October 2009, 12:10
Here's an AVIsynth script with the calculations in full...

http://forum.doom9.org/showthread.php?p=1257574#post1257574

...but if you make some assumptions, you can simplify it dramatically, as Alexander shows in that thread.

Cheers,
David.

sumawo13
29th October 2009, 13:28
Here's an AVIsynth script with the calculations in full...

http://forum.doom9.org/showthread.php?p=1257574#post1257574

...but if you make some assumptions, you can simplify it dramatically, as Alexander shows in that thread.

Cheers,
David.

This script does exactly what I want to do but unfortunately I'm not very good at interpreting other people's work so I was wondering if someone could explain to me the math involved so I can write my own script. :)