View Single Post
Old 27th June 2017, 15:24   #12  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,374
Quote:
Originally Posted by Richard1485 View Post
^ Thanks! I have two problems though.

First, I don't know how to adapt the above to a script in which a clip is already defined. Obviously, in your example, everything is being assigned to last. Normally, I would so something like...

Code:
s1=WhateverSource()
Trim(s1,x,y).Whatever().Whatever()
...but I can't do that here, because I have to define quantities (fc and m) in the middle of calls to various functions and AviSynth throws an error.

Secondly, if I change n to one, the above doesn't seem to be increasing the number of frames by one. I'm not sure why.

Code:
m = float(fc+1)/fc




Probably because of implicit "last"

You can specify exactly what you're referring to (eg. which framecount, the original, cuta , cutb, etc...)

here a1 is defined as segment (1000-2000), and that is what the framecount refers to, not original or some other cut. You would do that for each section you're trying to stretch to keep it organized

Code:
orig=last

n=4

a1=orig.trim(1000,2000)
fc = a1.Framecount()
m = float(fc+n)/fc


a1
timestretch(tempo=100/m)
changefps(m*last.framerate)
assumefps(24000,1001)
poisondeathray is offline   Reply With Quote