Leo D9
16th November 2018, 17:06
Simple example:
AssumeFPS(BlankClip(), numerator=30000, denominator=1001)
Result:
Script error: Invalid arguments to function "AssumeFPS"
I can't work out why, and searching revealed nothing.
Also:
ConvertFPS(BlankClip(), numerator=30000, denominator=1001)
Result:
Script error: ConvertFPS does not have a named argument "numerator"
I've tried upgrading AviSynth to 2.60 (official build) Feb 20 2015 but it is the same.
(I know there are presets I can use for 30000/1001 but I actually want to use other numerators and denominators.)
videoh
16th November 2018, 17:17
This works:
AssumeFPS(30000, 1001)
StainlessS
16th November 2018, 18:09
As VideoH said.
Numerator is NON Optional (and un-named)
http://avisynth.nl/index.php/FPS#AssumeFPS
AssumeFPS(clip clip, float fps [, bool sync_audio])
AssumeFPS(clip clip, int numerator [, int denominator, bool sync_audio]) # Optional in blue, numerator is NON OPTIONAL (and NOT named)
AssumeFPS(clip clip1, clip clip2 [, bool sync_audio])
AssumeFPS(clip clip1, string preset [, bool sync_audio])
Above, In docs, square bracketed ('[...]'), denotes optional (and named).
eg
AssumeFPS(BlankClip, 25)
AssumeFPS(BlankClip, 25,1)
AssumeFPS(BlankClip, 25,denominator=1)
If was a script function, would be prototype something like
AssumeFPS(clip c, int numerator, int "denominator", ... etc) # note denominator in double quotes, ie named, & optional
Above, the name 'numerator' is there just so that the argument can be referred to in the docs.
So, below will work
ConvertFPS(BlankClip(), 30000, denominator=1001)
EDIT: Also note, optional implies that it will default if not supplied, in above case denominator will default to 1, where numerator will not default and must be supplied.
Also note, that in first code block, the 2nd arg is always non optional (and all are different types), and the user supplied 2nd argument type is used to resolve the intended prototype .
EDIT:
(I know there are presets I can use for 30000/1001 but I actually want to use other numerators and denominators.)
numerator = 30000
denominator = 1001
ConvertFPS(BlankClip(), numerator, denominator=denominator)
#ConvertFPS(BlankClip(), numerator, denominator)
#BlankClip(fps=numerator,fps_denominator=denominator) # For BlankClip, fps is also optional & named
BlankClip:- http://avisynth.nl/index.php/BlankClip
EDIT: Below in red from docs should be NOTED (I was not aware of it).
int fps_denominator = 1
Specify frame rate in rational form (numerator/denominator). For example, fps=30000,fps_denominator=1001 (approximately 29.97 fps) or fps=24000,fps_denominator=1001 (approximately 23.976 fps).
Note – if fps_denominator is given (even if it is "1"), fps is rounded to the nearest integer.
EDIT: Below Untested.
Function Test(Float "FPS", Int "Fps_Denominator") {
FPS = (Fps_Denominator.Defined) ? Int(Default(FPS,24)) : Float(Default(FPS,24.0)) # FPS is already forced to type FLOAT if avs v2.60+
Fps_Denominator=Default(Fps_Denominator, Undefined() ) # Same as Not assigning Default() to Fps_Denominator. Can comment out, same effect.
return BlankClip(fps=FPS,fps_denominator=Fps_Denominator) # will be as fps_denominator=Undefined, if fps_denominator not supplied.
}
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.