digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth encapsulation help? (http://www.digitalfaq.com/archives/avisynth/4330-avisynth-encapsulation.html)

FredThompson 07-04-2003 03:56 PM

Avisynth encapsulation help?
 
I'm having a heck of a time adapting the optimal script to field-oriented execution for use with pure-video sources.

AviSynth 2.5x seems to choke on this script. Can anyone help figure out what's going wrong?

I don't care if a function is used or not. All it needs is a way to encapsulate the kvcd lines.

The ReverseFieldDominance lines ensures we're always working with proper TFF

AVISource("source.avi")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\asharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ReverseFieldDominance.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\STMedianFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\unfilter.dll")
Limiter(min_luma=16)
GetParity() ? nop() : ReverseFieldDominance()
even=SelectEven(SeparateFields()).KVCD_Filter()
odd=SelectOdd(SeparateFields()).KVCD_Filter()
Interleave(even,odd).Weave()
Limiter(min_luma=16)

##########################

function KVCD_Filter(){

MaxTreshold = 1.50
nf = 0 # Current frame.

undot()
limiter()
asharp(2, 4)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.2))

ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) ,0, 2) ")

Limiter()

return }

function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2}

kwag 07-04-2003 04:16 PM

Hi Fred,

Have you tried the script with this line removed :?:
GetParity() ? nop() : ReverseFieldDominance()

-kwag

FredThompson 07-04-2003 06:09 PM

Because you asked, I tried it. No go.

That's a non-destructive field-dominance swap. Camcorder DV is BFF and using that method ensures everything is always TFF. Or is it the other way around? In any event, Camcorder DV is backwards and this fies it.

I now think the problem comes from the routines in the KVCD filter and not explicitly telling them which stream to operate on. If you look at the documentation for undot and asharp you'll see there isn't anything about passing them a clip parameter.

It doesn't really matter if the KVCD stuff is put inside a function or some other construct. It just needs to be assigned to an alias of some sort so a clip can be run through it.

There are some real crude ways of making it work but the best is to have all the KVCD stuff in one area so it can be easily updated.

I haven't found anything in the documentation about designating a particular clip as being the default clip. That might be real helpful.

kwag 07-04-2003 07:01 PM

I asked you about the function, because nop() won't work the way you have it set :!:
In AviSynth conditionals, you must return a clip. So in your "false" condition, ReverseFieldDominance() is returned. But on the true condition, Nop() is returned but no clip is returned. Thus you'll get an error on your script :)

-kwag

FredThompson 07-04-2003 08:09 PM

Oh, huh, well, I haven't run into a problem yet.

I was trying to do a simple if...then.

The website and installed documentation aren't the same and neither has a proper lexical indexing strucutre like you'd see in formal language definitions. They're close but not quite there. Can be very frustrating at times. It's kind of like learnigna language from a dictionary, the word definitions are there but no grammar guide.

How do you suggest this conditional processing be properly coded?

kwag 07-04-2003 08:12 PM

Look at this thread: http://www.kvcd.net/forum/viewtopic.php?t=4499 specially at sh0dan's answers to the exact problem ;)

-kwag


All times are GMT -5. The time now is 07:26 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.