Simplify your AVS scripts
If you want to save some typing in the future, try using the Import function the next time you make an avisynth script.
Here is a sample script I have created where all of the LoadPlugin lines have been moved into a functions file. Code:
Import ("C:\filters\functions.h") Regards, Tenra |
Thanks Tenra!
This should save a lot of cutting and pasting 8) I'm going to have to try out your predict 2 function- how come you didn't share this before? just kidding :wink: Also the Sampler function is different 8O did i miss something in the file prediction forum? :?: 8O 8O ren |
I haven't posted yet because I only just finished those functions.
The sampler is my first attempt at creating a function. The benefit of this one over the sampler.dll is that the formula for prediction is always (samplesize * 60) no matter the framerate. The predict2 function allows you to base future guesses on 2 samples instead of just one. Regards, Tenra |
I tried your Predict2 function and it works great! You found the workaround for the division by zero error when the cq or sample size =0 8) I don't see any reason to keep the other prediction funtion anymore so that's less typing there :D
I don't know how to use your sampler function though- should i set the length parameter {i.e. sampler(length=24)}? thx, ren |
Quote:
|
BTW, what is Predict2 and where can I download it? :)
|
hi SansGrip,
Predict2 is in the function.h file Tenra posted above Code:
#------------------------------# ren |
Quote:
Quote:
Quote:
Lastly, I posted the url to my functions in the original post. Here it is again. http://users.bwsys.net/~djvande/functions.h Enjoy! :D |
Quote:
|
By the way, did you check your SampleClip produces exactly the right frame count? One of the reasons I wrote Sampler is because SelectEvery seemed to be out by a significant number of frames, while Sampler produces exactly (length * samples) frames.
|
Quote:
Regards, Tenra |
hey Tenra,
There's a little bug in the Predict2 function that when both samples are the same size then the newCQ is displayed funny (i think because of division by 0)- i know both samples shouldn't be the same size but just to keep avisynth from possibly crashing i added these lines: Code:
difSamples = Samp2 - Samp1 |
Thanks ren! I have added it to my script. I also now have functions.h as part of my sig so it should be easier to grab in the future.
Regards, Tenra |
Hi Tenra
Not sure how to use your predict2 function, the arguments etc. Could you supply a bit more explanation on how to set it up and what it produces. Thanks Jeff |
Jeff,
Here is an explanation of the predict2 function: First your avs script should look like this. Code:
Import ("C:\filters\functions.h") movie="moviename" #Enter the name of the movie(Default=No_Title_Defined) cds= #Enter the number of CDs you are targeting (Default=1) cdtime= #Enter whether you have 74 or 80 minute CD (Default=80) factor= #Enter the scale factor for sample sizes (Default=1) Samp1= #Enter the size in MB of your first sample created Samp2= #Enter the size in MB of your second sample created CQ1= #Enter the CQ used to create the first sample CQ2= #Enter the CQ used to create the second sample AudioBitrate= #Enter the Bitrate you will encode the audio at (Default=128) Regards, Tenra |
OK, i'm confused.
Should i have the Prediction(blah, blah, blah) AND the Predict2(blah, blah, blah) in my script, or just the Predict2(blah, blah, blah)? |
You only need the Predict2(blah, blah, blah) :wink:
-Tenra |
So this:
Code:
Import ("G:\sample avisynth scripts\functions.h") I encode the first time and fill in samp1= and cq1=, encode a second time and fill in samp2= and cq2= and it will then tell me what final cq to use? |
Yes. That's the idea. The only thing is that you have some of the parameters out of order. Here is the correct order:
Code:
Predict2 (clip, movie, cds, cdtime, factor, Samp1, Samp2, CQ1, CQ2, AudioBitrate) When you have all 0s for the first run it will always suggest CQ 50. After you have filled in the Samp1 and CQ1 then it will try to predict a better CQ. When you have filled in Samp2 and CQ2 then it will use both and find a value in between proportionate to the difference between the two. Code:
Example: Desired sample size will be 12.16MB Regards, Tenra |
Quote:
ok,laugh but lost. i was out,very busy and lost something (or all)! :oops: how to use it all,ARnet_tenRA? in special the "(blah, blah, blah)" 8O thanks |
Here is an example that I have used for Predict2.
Predict2 (movie="Shrek", cds=1, cdtime=80, factor=1, Samp1=10, Samp2=13, CQ50, CQ53.8, AudioBitrate=112) Samp1 and Samp2 are listed in MB. AudioBitrate is in Kbps When you run this you will get a new suggested CQ as the first frame of your movie. Regards, Tenra |
Quote:
it's all seems very special! i save in my "guide folder".(my special folder :D ) 8) |
jorel,
have you tried SampleClip function yet? It allows you to make a full size sample or make a shorter one. Just another thing to complicate matters. :wink: -Tenra |
Quote:
can you help friend ARnet_tenRA? (net_ten) :wink: thanks in advance! :D |
Good to meet you too jorel. :)
SampleClip() #will produce a standard sample which is 1/60 of your movie. SampleClip(10) #will produce a clip 1/10th the size of the above. 1/600th of your movie. You can use any interger and it will be 1/60*<number>th :wink: of your movie. Regards, Tenra |
Quote:
|
:wink:
thanks friend ARnet_tenRA, i have to read all and try now. seems amazing. :D ps: was a pleasure knows about the prog,is new for me..... knows you ARnet_tenRA("net_ten"), was pleasure,is a pleasure and remains a pleasure.... ...for me and for everyone here! :wink: thanks my friend. :D |
Quote:
-Tenra |
friends help me.....i read the thread and:
i don't know how can i load and use the functions.h than i'm: :? , :cry: and :grrr: and :bawl: too! help please! what i do? :? ps: you know.....of course :imstupid: |
Hi Jorel,
Look at this .avs I'm using for testing: Code:
Import("C:\filters\functions.h") That line imports all the DLL's and functions. :wink: -kwag |
What exactly is the "clip" parameter for?
|
Quote:
with a script turn it's easy to understand! :D |
mergechroma/mergeluma, SpaceDust, FluxSmooth, NoMoSmooth, Convolution3d
ALL this filters together? :jawdrop: :jawdrop: :jawdrop: :jawdrop: :jawdrop: :jawdrop: :jawdrop: |
Quote:
-kwag |
OK... I saw that :wink:
But even for a test it is a 8O |
Quote:
I actually settled for: Code:
mergechroma(blur(1.50)) -kwag |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.