Quantcast Avisynth Encapsulation Help? - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Avisynth Scripting

Reply
 
LinkBack Thread Tools
  #1  
07-04-2003, 03:56 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
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}
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
07-04-2003, 04:16 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Fred,

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

-kwag
Reply With Quote
  #3  
07-04-2003, 06:09 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #4  
07-04-2003, 07:01 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #5  
07-04-2003, 08:09 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Reply With Quote
  #6  
07-04-2003, 08:12 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Look at this thread: http://www.kvcd.net/forum/viewtopic.php?t=4499 specially at sh0dan's answers to the exact problem

-kwag
Reply With Quote
Reply







 
All times are GMT -5. The time now is 08:20 AM  —  vBulletin © Jelsoft Enterprises Ltd