View Single Post
Old 27th November 2011, 09:59   #22  |  Link
vampiredom
Registered User
 
Join Date: Aug 2008
Posts: 233
GuessPAR() function

OK, it's pretty basic but it may be helpful (and avoid the hassle of having to look up the "standard" PARs.)

** EDIT: The GuessPAR() function is now a part of PARResizer.avsi ... see this thread.

The first parameter can be either a clip or a string in the format of "640x480", or "720x576", etc.

The second parameter, ws, specifies whether the widescreen PARs (ws=true) or standard 4:3 PARs (ws=false) should be assumed (since there is no way to automatically guess this).

GuessPAR() will return 1.0 if it cannot find a matching non-square pixel standard for the given dimensions.

Examples:

Code:
# load a widescreen .avi file
AviSource("MyFile.avi")
par = GuessPAR(last, ws=true)
Subtitle(String(par))
Code:
# Print an arbitrary PAR
BlankClip()
par = GuessPAR("704x480", false)
Subtitle(String(par))

Last edited by vampiredom; 27th November 2011 at 22:53. Reason: function has been moved to PARResizer.avsi
vampiredom is offline   Reply With Quote