Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th November 2018, 17:06   #1  |  Link
Leo D9
Registered User
 
Join Date: Feb 2013
Posts: 10
Numerator argument always causes an error

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.)
Leo D9 is offline   Reply With Quote
Old 16th November 2018, 17:17   #2  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
This works:

AssumeFPS(30000, 1001)
videoh is offline   Reply With Quote
Old 16th November 2018, 18:09   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
As VideoH said.

Numerator is NON Optional (and un-named)
http://avisynth.nl/index.php/FPS#AssumeFPS
Code:
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
Code:
AssumeFPS(BlankClip, 25)
AssumeFPS(BlankClip, 25,1)
AssumeFPS(BlankClip, 25,denominator=1)
If was a script function, would be prototype something like
Code:
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
Code:
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:
Quote:
Originally Posted by Leo D9 View Post
(I know there are presets I can use for 30000/1001 but I actually want to use other numerators and denominators.)
Code:
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).
Quote:
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.
Code:
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.
}
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 17th November 2018 at 11:29.
StainlessS is offline   Reply With Quote
Reply

Tags
assumefps, convertfps, invalid argument, no named argument, numerator

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.