Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th June 2008, 23:06   #21  |  Link
zemog
Registered User
 
Join Date: Sep 2006
Location: Madrid (Spain)
Posts: 20
Quote:
Originally Posted by mikeytown2 View Post
BTW what does AGG stand for?
Nothing important, just an identifier, based in my family name, that I used to add to the functions written by my for my own use.
If you add some improvement or new feature, you can change it at your preference.
zemog is offline   Reply With Quote
Old 25th June 2008, 23:13   #22  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Quote:
Originally Posted by Gavino View Post
[EDIT: I bet you tested it with static clips, eg ColorBars ]
how did u know?!?!

Thanks for the input, I think all the problems fixed now. As for pc_range=true, it probably has something to do with the mask. IanB used it in post #9 above. I also added an audio check.

Code:
# DissolveAGG() June 25th, 2008
#  Dissolve with a Wipe. Wipe has alpha channel mask for nice effect.
#
# Inputs
#  clip a - starting clip 
#  clip b - ending clip
#  int "Duration" - Number of overlapped frames
#  string "Mode" - Four modes are possible: LeftToRight, RightToLeft, TopToBottom, BottomToTop.
#  float "WindowSize" - 2.0 is default. larger: more sharp.
#  float "MaskSharpnessStart" - 1: Big Blur; 100: Sharpest. Default 50.
#  float "MaskSharpnessEnd" - 1: Big Blur; 100: Sharpest. Default 50.


Function DissolveAGG(clip a, clip b, int "Duration", string "Mode", float "WindowSize", float "MaskSharpnessStart", float "MaskSharpnessEnd")
{
	#Set Defaults
	Duration=Default(Duration,30)
	width=a.width()
	height=a.height()
	Mode=Default(Mode, "LeftToRight")
	MaskSharpnessStart=Default(MaskSharpnessStart, 50.0)
	MaskSharpnessEnd=Default(MaskSharpnessEnd, 50.0)
	WindowSize=Default(WindowSize, 2.0)
	AudioMix=Dissolve(a, b, Duration).KillVideo()
	a = a.KillAudio()
	b = b.KillAudio()
	
	#Check Input
	Assert(Mode=="LeftToRight" || Mode=="RightToLeft" || Mode=="TopToBottom" || Mode=="BottomToTop", 
	\"DissolveAGG: Only Four Modes are possible: LeftToRight, RightToLeft, TopToBotoom BottomToTop. Mode=" + Mode)
	Assert(Duration >= 0, "DissolveAGG: Duration [" + String(Duration) + "] must be a positive value")
	Assert(Duration <= a.Framecount()-1, "DissolveAGG: Duration[" + String(Duration) + "] is greater then " + Chr(10) + "clip A length[" + String(a.Framecount()-1) + "]")
	Assert(Duration <= b.Framecount()-1, "DissolveAGG: Duration[" + String(Duration) + "] is greater then " + Chr(10) + "clip B length[" + String(b.Framecount()-1) + "]")
	
	#Set Parameters
	EvalString = Mode=="LeftToRight"? "BlankWidth=Int(4/2*WindowSize)
	BlankHeight=height
	startX1=BlankWidth + 0.5
	endX1=1.5
	startY1=0
	endY1=0
	x2=WindowSize*2-2
	y2=0
	ClipLeft=b
	ClipLeftStart=0
	ClipLeftEnd=Duration
	ClipRight=a
	ClipRightStart=FrameCount(a)-Duration-1
	ClipRightEnd=0" : Mode=="RightToLeft"? "BlankWidth=Int(4/2*WindowSize)
	BlankHeight=height
	startX1=1.5
	endX1=BlankWidth + 0.5
	startY1=0
	endY1=0
	x2=WindowSize*2-2
	y2=0
	ClipLeft=a
	ClipLeftStart=FrameCount(a)-Duration-1
	ClipLeftEnd=0
	ClipRight=b
	ClipRightStart=0
	ClipRightEnd=Duration" : Mode=="TopToBottom"? "BlankWidth=height
	BlankHeight=Int(6/2*WindowSize)
	startX1=0
	endX1=0
	startY1=BlankHeight + 0.5
	endY1=3.5
	x2=0
	y2=WindowSize*2-2
	ClipLeft=b
	ClipLeftStart=0
	ClipLeftEnd=Duration
	ClipRight=a
	ClipRightStart=FrameCount(a)-Duration-1
	ClipRightEnd=0" : Mode=="BottomToTop"? "BlankWidth=height
	BlankHeight=Int(6/2*WindowSize)
	startX1=0
	endX1=0
	startY1=3.5
	endY1=BlankHeight + 0.5
	x2=0
	y2=WindowSize*3-4
	ClipLeft=a
	ClipLeftStart=FrameCount(a)-Duration-1
	ClipLeftEnd=0
	ClipRight=b
	ClipRightStart=0
	ClipRightEnd=Duration" : ""
	Eval(EvalString)

	#Make Mask
	BlackBar = BlankClip(a, length=Duration+1, width=BlankWidth, height=BlankHeight, pixel_type="RGB32")
	WhiteBar = BlankClip(BlackBar, color=$FFFFFF)
	BWmask = Mode=="LeftToRight" || Mode=="RightToLeft" ? StackHorizontal(BlackBar,WhiteBar) : StackVertical(BlackBar,WhiteBar) 
	BWmask = BWmask.Animate(0,Duration,"GaussResize",
	\ width, height, startX1, startY1, x2, y2, MaskSharpnessStart,
	\ width, height, endX1, endY1, x2, y2, MaskSharpnessEnd)
	
	#Glue it together
	Trim(a, 0, FrameCount(a)-Duration-1)
	last + Overlay(Trim(ClipLeft, ClipLeftStart, ClipLeftEnd), Trim(ClipRight, ClipRightStart, ClipRightEnd), mask=BWmask, pc_range=True) 
	last + Trim(b, Duration+1, 0)
	HasAudio(AudioMix) ? AudioDub(last,AudioMix) : last
}
mikeytown2 is offline   Reply With Quote
Old 26th June 2008, 01:44   #23  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
It's more or less there, but I think it's still not quite right.
Frame Framecount(a)-Duration-1 of a is repeated.
(ShowFrameNumber can be useful for testing these sort of things.)

I'm not sure about this bit, but the way I see it, the mask should be of length Duration.
Clip a's part in the transition should run from Framecount(a)-Duration to the end, and clip b's part from 0 to Duration-1.
Then the final part of the total should be b.Trim(Duration, 0).
Or is it just that the mask is extended by one frame at the end to cover the first full frame of b, and it all works out? (If so, why don't you need to do the same at the beginning of the mask, making it Duration+2?)

In the validation checks, Duration needs to be strictly > 0 (perhaps even > 1 in the light of the above), otherwise Animate will fail (and you have 2 typos ("then") in the error msgs).
(Funny how it's always easier to spot errors in someone else's code. )

As for pc_range, I imagine IanB had a good reason. but I'd like to understand it as pc_range does not affect the mask in Overlay.

EDIT: I'm now wondering if in fact you need to append a blank frame to a, prepend a blank frame to b, and use a mask of length Duration+2 ??

Last edited by Gavino; 26th June 2008 at 02:02. Reason: further thought!
Gavino is offline   Reply With Quote
Old 26th June 2008, 16:04   #24  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Here's an update which I think gets the transition boundaries exactly right. It even handles a Duration of 0, which effectively reduces to a splice.

I've also made MaskSharpnessEnd default to MaskSharpnessStart so you only have to specify the latter one if you want them to be the same. Also did some minor fixes and tidying up.
Code:
# DissolveAGG() June 27th, 2008
#  Dissolve with a Wipe. Wipe has alpha channel mask for nice effect.
#
# Inputs
#  clip a - starting clip 
#  clip b - ending clip
#  int "Duration" - Number of overlapped frames
#  string "Mode" - Four modes are possible: LeftToRight, RightToLeft, TopToBottom, BottomToTop.
#  float "WindowSize" - 2.0 is default. larger: more sharp.
#  float "MaskSharpnessStart" - 1: Big Blur; 100: Sharpest. Default 50.
#  float "MaskSharpnessEnd" - 1: Big Blur; 100: Sharpest. Default 50.


Function DissolveAGG(clip a, clip b, int "Duration", string "Mode", float "WindowSize", float "MaskSharpnessStart", float "MaskSharpnessEnd")
{
#Set Defaults
Duration=Default(Duration,30)
width=a.width()
height=a.height()
Mode=Default(Mode, "LeftToRight")
MaskSharpnessStart=Default(MaskSharpnessStart, 50.0)
MaskSharpnessEnd=Default(MaskSharpnessEnd, MaskSharpnessStart)
WindowSize=Default(WindowSize, 2.0)
AudioMix=Dissolve(a, b, Duration).KillVideo()
a = a.KillAudio()
b = b.KillAudio()

#Check Input
Assert(Mode=="LeftToRight" || Mode=="RightToLeft" || Mode=="TopToBottom" || Mode=="BottomToTop", 
\"DissolveAGG: Only Four Modes are possible: LeftToRight, RightToLeft, TopToBottom, BottomToTop. Mode=" + Mode)
Assert(Duration >= 0, "DissolveAGG: Duration [" + String(Duration) + "] must not be a negative value")
Assert(Duration < a.Framecount(), "DissolveAGG: Duration[" + String(Duration) + "] must be less than " + Chr(10) + "clip A length[" + String(a.Framecount()) + "]")
Assert(Duration < b.Framecount(), "DissolveAGG: Duration[" + String(Duration) + "] must be less than " + Chr(10) + "clip B length[" + String(b.Framecount()) + "]")

#Set Parameters
aMid = Trim(a, FrameCount(a)-Duration, 0)
bMid = Trim(b, 0, -Duration)
EvalString = Mode=="LeftToRight"? "BlankWidth=Int(4/2*WindowSize)
BlankHeight=height
startX1=BlankWidth + 0.5
endX1=1.5
startY1=0
endY1=0
x2=WindowSize*2-2
y2=0
ClipLeft=bMid
ClipRight=aMid" : Mode=="RightToLeft"? "BlankWidth=Int(4/2*WindowSize)
BlankHeight=height
startX1=1.5
endX1=BlankWidth + 0.5
startY1=0
endY1=0
x2=WindowSize*2-2
y2=0
ClipLeft=aMid
ClipRight=bMid" : Mode=="TopToBottom"? "BlankWidth=width
BlankHeight=Int(6/2*WindowSize)
startX1=0
endX1=0
startY1=BlankHeight + 0.5
endY1=3.5
x2=0
y2=WindowSize*3-4
ClipLeft=bMid
ClipRight=aMid" : Mode=="BottomToTop"? "BlankWidth=width
BlankHeight=Int(6/2*WindowSize)
startX1=0
endX1=0
startY1=3.5
endY1=BlankHeight + 0.5
x2=0
y2=WindowSize*3-4
ClipLeft=aMid
ClipRight=bMid" : ""
Eval(EvalString)

#Make Mask
BlackBar = BlankClip(a, length=Duration+2, width=BlankWidth, height=BlankHeight, pixel_type="RGB32")
WhiteBar = BlankClip(BlackBar, color=$FFFFFF)
BWmask = Mode=="LeftToRight" || Mode=="RightToLeft" ? StackHorizontal(BlackBar,WhiteBar) : StackVertical(BlackBar,WhiteBar) 
BWmask = BWmask.Animate(0,Duration+1,"GaussResize",
\ width, height, startX1, startY1, x2, y2, MaskSharpnessStart,
\ width, height, endX1, endY1, x2, y2, MaskSharpnessEnd)
\ .Trim(1, Duration)

#Glue it together
Trim(a, 0, FrameCount(a)-Duration-1)
last = (Duration > 0 ? last + Overlay(ClipLeft, ClipRight, mask=BWmask, pc_range=True) : last)
last + Trim(b, Duration, 0)
HasAudio(AudioMix) ? AudioDub(last,AudioMix) : last
}

Last edited by Gavino; 27th June 2008 at 12:27. Reason: Further fixes
Gavino is offline   Reply With Quote
Old 27th June 2008, 12:29   #25  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Another bug fixed (mask handling in TopToBottom mode with non-default Window). Edited previous post rather than posting it all again.

Thanks to mikeytown2 for doing most of the hard work on this version, gracias a zemog for original version and credit to IanB for outline idea.
Gavino is offline   Reply With Quote
Old 27th June 2008, 23:08   #26  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I have a problem with FadeIn0 and FadeOut0. I am using the following simple script:

Code:
video=Mpeg2source("X:\wherever\clip.d2v")
audio=NicAC3Source("X:\wherever\clip.ac3")
AudioDub(Video,Audio)
SeparateFields() 
Spline36Resize(656,224)
AddBorders(32,8,32,8)
FadeIn0(30)
FadeOut0(60)
Weave()
But it seems like the fade-out only lasts 30 frames and the fade-in isn't even considered at all. Am I missing something?
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 28th June 2008, 00:01   #27  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
You need to put the fades after the Weave (which halves the framerate). The fade-in probably was there, but would have been only 15 frames and so easily missed, especially if your clip starts off dark.

BTW I'm not sure if this really belongs in this thread, although I suppose it's in the same general area.
Gavino is offline   Reply With Quote
Old 28th June 2008, 09:13   #28  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Gavino, thanks for polishing up the function! Been busy for the last couple of days.

Chainmax you could try adding the fades before SeparateFields() as well. Other then that, I have no idea on the fade in.
mikeytown2 is offline   Reply With Quote
Old 2nd July 2008, 00:18   #29  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
....or just double the framecount, so that it actually fades every field (as you'd want for interlaced material), instead of screwing up the temporal fade.
foxyshadis is offline   Reply With Quote
Old 8th July 2008, 07:03   #30  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Starting to get somewhere... I'm using Fizick's Rotation Plugin (1.31) to rotate the mask.
http://avisynth.org.ru/rotate/rotate.html

Code:
# DissolveAGG() July 7th, 2008
#  Dissolve with a Wipe. Wipe has alpha channel mask and selectable angle for nice effect.
#
# Inputs
#  clip a - starting clip 
#  clip b - ending clip
#  int "Duration" - Number of overlapped frames
#  float "Angle" - Angle of the wipe
#  string "Mode" - Four modes are possible: LeftToRight, RightToLeft, TopToBottom, BottomToTop.
#  float "WindowSize" - 2.0 is default. larger: more sharp.
#  float "MaskSharpnessStart" - 1: Big Blur; 100: Sharpest. Default 50.
#  float "MaskSharpnessEnd" - 1: Big Blur; 100: Sharpest. Default 50.


Function DissolveAGG(clip a, clip b, int "Duration", float "Angle", float "EndAngle", string "Mode", float "WindowSize", float "MaskSharpnessStart", float "MaskSharpnessEnd")
{
#Set Defaults
Duration=Default(Duration,Round(Framerate(a)))
Angle=Default(Angle,0)
EndAngle=Default(EndAngle,Angle)
width=a.width()
height=a.height()
Diagonal = Ceil(sqrt(pow(width(a),2)+pow(height(a),2)))

Mode=Default(Mode, "LeftToRight")
MaskSharpnessStart=Default(MaskSharpnessStart, 50.0)
MaskSharpnessEnd=Default(MaskSharpnessEnd, MaskSharpnessStart)
WindowSize=Default(WindowSize, 2.0)
AudioMix=Dissolve(a, b, Duration).KillVideo()
a = a.KillAudio()
b = b.KillAudio()

#Check Input
Assert(Mode=="LeftToRight" || Mode=="RightToLeft" || Mode=="TopToBottom" || Mode=="BottomToTop", 
\"DissolveAGG: Only Four Modes are possible: LeftToRight, RightToLeft, TopToBottom, BottomToTop. Mode=" + Mode)
Assert(Duration >= 0, "DissolveAGG: Duration [" + String(Duration) + "] must not be a negative value")
Assert(Duration < a.Framecount(), "DissolveAGG: Duration[" + String(Duration) + "] must be less than " + Chr(10) + "clip A length[" + String(a.Framecount()) + "]")
Assert(Duration < b.Framecount(), "DissolveAGG: Duration[" + String(Duration) + "] must be less than " + Chr(10) + "clip B length[" + String(b.Framecount()) + "]")



#Set Parameters
aMid = Trim(a, FrameCount(a)-Duration, 0)
bMid = Trim(b, 0, -Duration)
EvalString = Mode=="LeftToRight"? "BlankWidth=Int(4/2*WindowSize)
BlankHeight=Diagonal
startX1=BlankWidth + 0.5
endX1=1.5
startY1=0
endY1=0
x2=WindowSize*2-2
y2=0
ClipLeft=bMid
ClipRight=aMid" : Mode=="RightToLeft"? "BlankWidth=Int(4/2*WindowSize)
BlankHeight=Diagonal
startX1=1.5
endX1=BlankWidth + 0.5
startY1=0
endY1=0
x2=WindowSize*2-2
y2=0
ClipLeft=aMid
ClipRight=bMid" : Mode=="TopToBottom"? "BlankWidth=Diagonal
BlankHeight=Int(6/2*WindowSize)
startX1=0
endX1=0
startY1=BlankHeight + 0.5
endY1=3.5
x2=0
y2=WindowSize*3-4
ClipLeft=bMid
ClipRight=aMid" : Mode=="BottomToTop"? "BlankWidth=Diagonal
BlankHeight=Int(6/2*WindowSize)
startX1=0
endX1=0
startY1=3.5
endY1=BlankHeight + 0.5
x2=0
y2=WindowSize*3-4
ClipLeft=aMid
ClipRight=bMid" : ""
Eval(EvalString)

#Make Mask
BlackBar = BlankClip(a, length=Duration+2, width=BlankWidth, height=BlankHeight, pixel_type="RGB32")
WhiteBar = BlankClip(BlackBar, color=$FFFFFF)
BWmask = Mode=="LeftToRight" || Mode=="RightToLeft" ? StackHorizontal(BlackBar,WhiteBar) : StackVertical(BlackBar,WhiteBar) 
BWmask = BWmask.Animate(0,Duration+1,"GaussResize",
\ Diagonal, Diagonal, startX1, startY1, x2, y2, MaskSharpnessStart,
\ Diagonal, Diagonal, endX1, endY1, x2, y2, MaskSharpnessEnd)
BWmask = BWmask.Trim(1, Duration).Animate(0, framecount(BWmask)-1, "Rotate", Angle, $000000, 0, -1, Angle, width, height,  EndAngle, $000000, 0, -1, EndAngle, width, height)

#Glue it together
Trim(a, 0, FrameCount(a)-Duration-1)
last = (Duration > 0 ? last + Overlay(ClipLeft, ClipRight, mask=BWmask, pc_range=True) : last)
last + Trim(b, Duration, 0)
HasAudio(AudioMix) ? AudioDub(last,AudioMix) : last
}
Example
Code:
a = ColorBars(320,320).Trim(0,99)
b = a.invert()

DissolveAGG(a,b, 80, angle=-15.0, endangle=105.0, WindowSize=10)
It's not "perfect" because it uses the clip's Diagonal to calc the mask, thus the start and end is a little off. thats what the -15 and 105 is for. Ideally it would be 0 and 90. It falls apart if its not square like it is for the example.


Edit: I think if i where to use EffectRotation i could make this behave better, because i can select the center of rotation. I could do it with zoom as well now that i think about it. Doing that i should be able to keep the arc in the corner, and that should get rid of the -15 and 105 oddness. it will be hard to make this a smart function...

Last edited by mikeytown2; 10th July 2008 at 09:03.
mikeytown2 is offline   Reply With Quote
Old 9th July 2008, 15:16   #31  |  Link
NerdWithNoLife
Registered User
 
NerdWithNoLife's Avatar
 
Join Date: Jul 2007
Posts: 157
I don't know if this is what you want, but you can do a slide-in with KenBurnsEffect. Let's assume you have a 640x480 video:
Code:
a=AviSource("clipA.avi")
b=AviSource("clipB.avi")

StackHorizontal(a,b)
KenBurnsEffect(startFrame=0, endFrame=29, endPanX=0, startPanX=-640).crop(0,0,640,480)
I think it has to be RGB32, so you may have to add ConvertToRGB32()
NerdWithNoLife is offline   Reply With Quote
Old 10th July 2008, 08:38   #32  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 366
The link at the first post seems to be down, so I can't see what transition you're after. These are the avs transitions included in DVD slideshow GUI. They are just avisynth scripts located in the DVD slideshow GUI\Transitions folder.

A lot of them are done with vcmohan's great transall plugin.
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 10th July 2008, 10:40   #33  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Here's an UGLY hack of the above working with 0 and 90. Requires KenBurnsEffect

Code:
Function DissolveAGG_test(clip a, clip b, int "Duration", float "Angle", float "EndAngle", string "Mode", float "WindowSize", float "MaskSharpnessStart", float "MaskSharpnessEnd")
{
#Set Defaults
Duration=Default(Duration,Round(Framerate(a)))
Angle=Default(Angle,0)
EndAngle=Default(EndAngle,Angle)
width=a.width()
height=a.height()
Diagonal = Ceil(sqrt(pow(width(a),2)+pow(height(a),2)))

Mode=Default(Mode, "LeftToRight")
MaskSharpnessStart=Default(MaskSharpnessStart, 50.0)
MaskSharpnessEnd=Default(MaskSharpnessEnd, MaskSharpnessStart)
WindowSize=Default(WindowSize, 2.0)
AudioMix=Dissolve(a, b, Duration).KillVideo()
a = a.KillAudio()
b = b.KillAudio()

#Check Input
Assert(Mode=="LeftToRight" || Mode=="RightToLeft" || Mode=="TopToBottom" || Mode=="BottomToTop", 
\"DissolveAGG: Only Four Modes are possible: LeftToRight, RightToLeft, TopToBottom, BottomToTop. Mode=" + Mode)
Assert(Duration >= 0, "DissolveAGG: Duration [" + String(Duration) + "] must not be a negative value")
Assert(Duration < a.Framecount(), "DissolveAGG: Duration[" + String(Duration) + "] must be less than " + Chr(10) + "clip A length[" + String(a.Framecount()) + "]")
Assert(Duration < b.Framecount(), "DissolveAGG: Duration[" + String(Duration) + "] must be less than " + Chr(10) + "clip B length[" + String(b.Framecount()) + "]")



#Set Parameters
aMid = Trim(a, FrameCount(a)-Duration, 0)
bMid = Trim(b, 0, -Duration)
EvalString = "BlankWidth=Int(4/2*WindowSize)
BlankHeight=Diagonal
ClipLeft=bMid
ClipRight=aMid"
Eval(EvalString)

#Make Mask
BlackBar = BlankClip(a, length=Duration+2, width=BlankWidth, height=BlankHeight, pixel_type="RGB32")
WhiteBar = BlankClip(BlackBar, color=$FFFFFF)
BWmask = StackHorizontal(BlackBar,WhiteBar) 
BWmask = BWmask.GaussResize(width, Diagonal)
BWmask = BWmask.AddBorders(Diagonal-width/2,0,0,0).AddBorders(0,0,Diagonal-width/2,0,$FFFFFF)
BWmask = BWmask.Trim(1, Duration)
BWmask = StackVertical(BWmask, BlankClip(BWmask))
BWmask = BWmask.Animate(0, framecount(BWmask)-1, "Rotate", Angle, $000000, 0, -1, Angle, BWmask.width(), BWmask.height(),  EndAngle, $000000, 0, -1, EndAngle, BWmask.width(), BWmask.height())
BWmaskA = BWmask.Trim(0,-Duration/4).KenBurnsEffect(width=Round(width*1.0),height=Round(height*1.0),startzoomfactor=-100,endzoomfactor=-100, startalign=5, endalign=5, startpanX=-Diagonal-BlankWidth/8, endpanX=-Diagonal, startpanY=Diagonal/(float(width)/height), endpanY=Diagonal/(float(width)/height))
BWmaskB = BWmask.Trim(Duration/4,(Duration*3)/4-1).ZoomBox(Round(width*1.0),Round(height*1.0),zoomfactor=-100, align=5, panX=-Diagonal, panY=Diagonal/(float(width)/height))
BWmaskC = BWmask.Trim((Duration*3)/4,0).KenBurnsEffect(width=Round(width*1.0),height=Round(height*1.0),startzoomfactor=-100,endzoomfactor=-100, startalign=5, endalign=5, startpanX=-Diagonal, endpanX=-Diagonal, startpanY=Diagonal/(float(width)/height), endpanY=Diagonal/(float(width)/height)+BlankWidth/8)
BWmask = BWmaskA+BWmaskB+BWmaskC
#Glue it together
Trim(a, 0, FrameCount(a)-Duration-1)
last = (Duration > 0 ? last + Overlay(ClipLeft, ClipRight, mask=BWmask, pc_range=True) : last)
last + Trim(b, Duration, 0)
HasAudio(AudioMix) ? AudioDub(last,AudioMix) : last

#BWmask
}

a = ColorBars().Trim(0,99)
b = a.invert()

DissolveAGG_test(a,b, 80, 0.0, 90.0, WindowSize=20)
The main advantage of this function over transall is the blurred mask. The transition line is softer and adjustable with DissolveAGG

Last edited by mikeytown2; 10th July 2008 at 20:10. Reason: Ax ShowFrameNumber()
mikeytown2 is offline   Reply With Quote
Old 10th July 2008, 12:02   #34  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by mikeytown2 View Post
Code:
BWmaskA = BWmask.Trim(0,-Duration/4). etc
BWmaskB = BWmask.Trim(Duration/4,(Duration*3)/4-1). etc
BWmaskC = BWmask.Trim((Duration*3)/4,0). etc
BWmask = BWmaskA+BWmaskB+BWmaskC
I haven't tried it out or anything, but I can see that this part won't work with Duration < 4.
Bit messy to fix, perhaps easiest just to replace the last of these lines with
Code:
BWmask = Duration < 4 ? BWmask : BWmaskA+BWmaskB+BWmaskC
Extreme cases are the acid test of whether an algorithm is correct. A good test case is Duration=1 which should show a single frame with 50% of both clips.

BTW You've left a stray ShowFrameNumber on the line previous to these.

Last edited by Gavino; 10th July 2008 at 12:04.
Gavino is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.