digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Clip is upside down and mirror image!! (http://www.digitalfaq.com/archives/avisynth/7659-avisynth-clip-upside.html)

mistermickster 01-13-2004 10:10 AM

Avisynth: Clip is upside down and mirror image!!
 
Hi all,

A little help required here please :?

I read in this thread about placing common routines in a .avsi file in the Avisynth plugins directory, and calling it as a function.

With this in mind, I decided to cut the MA script in half and treat the main process as a function, like so;

Code:

####
#
function MAroutine(clip c, int width, int height) {
 
undot()
Limiter()
GripCrop(width,height)
GripSize(resizer="LanczosResize")
STMedianFilter(3, 3, 1, 1 )
MergeChroma(blur(1.5))
MergeLuma(blur(0.1))
#
#

## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual )
# This will apply variable temporalsoften
# and variable blur.
# Both filters are active at all times, and work inversely proportional to the
# activity, measured from current frame to next frame.

ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ).TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1)  ")

#
#
#

GripBorders()
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()

return c
}
#
#
## Functions ###

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

That could then be left alone and I could just amend a small calling script each time, like so;
Code:

(Johnny.avs)
####
## Main section and static filters ###
#
Mpeg2Source("C:\Movies\Johnny\johnny.d2v")
#

width=544
height=576
MAroutine(width, height)

#
####

Or so I thought :?

First problem, :( I tried opening the script in Media Player and VirtualDub. Both gave me an error saying that undot contained the incorrect number of parameters. I amended the "function" to include the clip (c) as a parameter.

Second problem, :cry: The movie is now upsidedown and mirror image :x

Can somebody else give this a try and let me know what I'm doing wrong.

Thnx guys

Krassi 01-13-2004 10:15 AM

Regarding the first problem:
Delete clip c, in
Code:

function MAroutine(clip c, int width, int height) {
to
Code:

function MAroutine(int width, int height) {
Still looking for the second error...

Dialhot 01-13-2004 10:43 AM

I think it's the opposite. A function should always refer to a clip as parameter, start with a filter using this same c, and finish with '"return c".

So try to keep your line "as it" and change the line with undot by "Undot(c)".

incredible 01-13-2004 10:51 AM

The function (clip c, .....

is important!

Just do it like this as I already pointed that out here:
http://www.kvcd.net/forum/viewtopic....ight=maroutine

Code:

Mpeg2Source("D:\mymovie.d2v")
undot()
GripCrop(width,height)
GripSize(resizer="LanczosResize")
STMedianFilter(3, 3, 1, 1 )
MergeChroma(blur(1.5))
Maroutine()
Gripborders()

And do safe this one to your AVS PlugIns Folder as "Maroutine.avsi":
Code:

#
function Maroutine(clip c) {
c=ScriptClip(c, "nf = YDifferenceToNext()"+chr(13)+"unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100))).TemporalSoften( fmin(round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1)* ")
return c
}

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


Krassi 01-13-2004 12:34 PM

Of course you two are right. I've just compared the parameters given to the avsi, sorry :oops:
Undot will be the first one claiming the clip name...

rds_correia 01-13-2004 04:32 PM

Hi guys,
Have I mentioned Incredible comes up with great routines??
I'm using MAroutine for a while and I thinks it's great to turn some good static scripts into MA scripts.
Nice work Incredible!...

incredible 01-13-2004 05:16 PM

I think the main routine inside doesn't come from me.
I just put that baby in a function, thats all, but thanx anyhow! ;-)


All times are GMT -5. The time now is 01:25 AM  —  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.