Quantcast Avisynth: Clip is Upside Down and Mirror Image!! - digitalFAQ.com Forums [Archives]
  #1  
01-13-2004, 10:10 AM
mistermickster mistermickster is offline
Free Member
 
Join Date: Jul 2003
Location: Blighty, PAL Land
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
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, The movie is now upsidedown and mirror image

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

Thnx guys
__________________
MisterMickster
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  
01-13-2004, 10:15 AM
Krassi Krassi is offline
Free Member
 
Join Date: Mar 2003
Location: Germany
Posts: 390
Thanks: 0
Thanked 0 Times in 0 Posts
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...
Reply With Quote
  #3  
01-13-2004, 10:43 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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)".
Reply With Quote
  #4  
01-13-2004, 10:51 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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 
}
Reply With Quote
  #5  
01-13-2004, 12:34 PM
Krassi Krassi is offline
Free Member
 
Join Date: Mar 2003
Location: Germany
Posts: 390
Thanks: 0
Thanked 0 Times in 0 Posts
Of course you two are right. I've just compared the parameters given to the avsi, sorry
Undot will be the first one claiming the clip name...
Reply With Quote
  #6  
01-13-2004, 04:32 PM
rds_correia rds_correia is offline
Free Member
 
Join Date: Apr 2003
Location: Chinese Democracy starts now!
Posts: 2,563
Thanks: 1
Thanked 0 Times in 0 Posts
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!...
__________________
Rui
Reply With Quote
  #7  
01-13-2004, 05:16 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
I think the main routine inside doesn't come from me.
I just put that baby in a function, thats all, but thanx anyhow!
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
TMPGEnc: Upside down video sticman Video Encoding and Conversion 15 12-29-2005 04:28 PM
KVCD: Downloads mirror? Prodater64 Video Encoding and Conversion 1 02-09-2005 07:19 PM
Avisynth: Need clip filter & dust filters for avisynth nighthawk Avisynth Scripting 3 01-31-2004 12:24 PM
Reinstalled XP and now Avisynth output is upside down Fiz Avisynth Scripting 4 06-17-2003 08:59 AM
Avisynth: How do you load an mpeg1 clip? rendalunit Avisynth Scripting 11 01-19-2003 02:32 PM

Thread Tools



 
All times are GMT -5. The time now is 11:21 AM  —  vBulletin Jelsoft Enterprises Ltd