View Full Version : Need Help with FadeOut and Dissolve
Deptmaster
24th September 2002, 13:56
I'm combining the last 2 episodes of cowboy bebop into one video and trimming out all the fat. I would like to fade out the last 20 frames or so instead of just cutting it before the credits roll in. Similarly I would like to either fade in "Clip2" or use Dissolve to merge the 2 together. I've tried but I have no experience with either filter and the guide isn't giving me much help.
Thanks, Ian
LoadPlugin("mpeg2dec.dll")
LoadPlugin("Decomb.dll")
mpeg2source("episode 25 & 26.d2v")
# Both episodes were combined in DVD2AVI
Telecide(Guide=1,Gthresh=50,Threshold=30,Chroma=true)
Decimate(5)
crop(6,0,711,480)
BicubicResize(640,432,0,0.5)
FadeOut(20,56966)
clip1 = Trim(0,30188)
clip2 = Trim(30260,56986)
UnalignedSplice(clip1,clip2)
hakko504
24th September 2002, 14:10
This script will fade out the first episode, and fade in the second:
LoadPlugin("mpeg2dec.dll")
LoadPlugin("Decomb.dll")
mpeg2source("episode 25 & 26.d2v")
# Both episodes were combined in DVD2AVI
Telecide(Guide=1,Gthresh=50,Threshold=30,Chroma=true)
Decimate(5)
crop(6,0,711,480)
clip = BicubicResize(640,432,0,0.5)
clip1 = clip.Trim(0,30188).fadeout(24) # 1 second (24/23.976) fadeout
#FadeIn is a little more complicated
clip2 = clip.Trim(30260,56986)
clip2 = Dissolve(Blackness(25, clip2), clip2, 24) # 1 second FadeIn
UnalignedSplice(clip1,clip2)
Or if you want one episode to fadeout at the same time as the next fades in:LoadPlugin("mpeg2dec.dll")
LoadPlugin("Decomb.dll")
mpeg2source("episode 25 & 26.d2v")
# Both episodes were combined in DVD2AVI
Telecide(Guide=1,Gthresh=50,Threshold=30,Chroma=true)
Decimate(5)
crop(6,0,711,480)
clip = BicubicResize(640,432,0,0.5)
Dissolve(clip.Trim(0,30188),clip.Trim(30260,56986),24) # 1 second overlap.
hakko504
24th September 2002, 14:17
@sh0dan or someone involved in AVIsynth 2.0x
Why not create the missing FadeIn command so we don't have to write Dissolve(Blackness(n+1,clip),clip,n) every time. Maybe also a FadeIO that would do both fade in and fade out. Like this:FadeIO(clip,f) = FadeIn(clip,f).FadeOut(clip,f)
FadeIO(clip,i,o) = FadeIn(clip,i).FadeOut(clip,o)
I'm quite sure it shouldn't be too hard to add those functions and really, I don't understand why Ben didn't add them from the beginning.
Deptmaster
24th September 2002, 14:54
Hey thanks for the quick reply hakko504, this is just what i needed. BTW- I'm getting a error: invalid arguments to function blackness, any clues why?
Thanks again, Ian
Wilbert
24th September 2002, 15:46
Try Blackness(clip2, 25) instead of Blackness(25, clip2).
droolian01
24th September 2002, 17:56
Hi there.
I capture stuff at least daily, most programs have 3 commercial breaks (are in 4 parts) and i use this script generically. I just use the one from a previous episode (say 6 feet under or buffy) leave it open and minimise, open vdub with my raw capture and scan along to my break points, copy/paste the frame numbers from the bottom of the vdub window straight into my old script and when done do a 'save as' new avs.
LOAD PLUGINS
.
.
avisource("CAPTUREbuf5-07.avi")
black=BlankClip(24,384,576,"YUY2",25,1,44100,true,true,$000000)
white=BlankClip(24,384,576,"YUY2",25,1,44100,true,true,$FFFFFF)
a=Dissolve(trim(322,9056),black,3)
b=Dissolve(trim(16224,35742),black,3)
c=Dissolve(trim(42548,66780),black,3)
d=Dissolve(trim(74124,84002),black,3)
dissolve(a,b,c,d,3)
.
.
. REST OF SCRIPT (FILTERS ETC..)
This script can be changed easily to fade in fade out any number of parts. also can fade to other colours - need this as 6 feet under sometimes fades to white,as wel as black. In the above example there are 4 buffy parts each fading to black.
Hope this is useful (i use it every day!)
FreQi
25th September 2002, 03:22
@hakko504
It's pretty simple to write your own functions using FadeOut() Reverse() and AudioDub() to do everything you want. I wrote these and just include them in my template script:
function fadein(clip clip, int F)
{ return clip.reverse.fadeout(F).reverse
}
function audfadeout(clip clip, int F)
{ a=clip.fadeout(F)
return audiodub(clip,a)
}
function audfadein(clip clip, int F)
{ a=clip.reverse.fadeout(F).reverse
return audiodub(clip,a)
}
function vidfadein(clip clip, int F)
{ v=clip.reverse.fadeout(F).reverse
return audiodub(v,clip)
}
function vidfadeout(clip clip, int F)
{ v=clip.fadeout(F)
return audiodub(v,clip)
}
With those you can do pretty much any kind of fade in/out. Here's some examples:
# get a sample
samp = Trim(30260,56986)
# will fade the audio in over the first 30 frames
one = samp.audfadein(30)
# will fade the video out over the last 30 frames
two = samp.vidfadeout(30)
# fades the audio in over 20 frames, but video over 50
three = samp.audfadein(20).vidfadein(50)
# fades the clip in and out
four = samp.fadein(30).fadeout(30)
Hope that helps.
hakko504
25th September 2002, 06:57
@FreQi
I already have done that, but thanks anyway. I still think those functions should be a part of AVIsynth and not something that every user must define for him/her-self.
FreQi
25th September 2002, 07:46
It probably wouldn't hurt to build them in as there are probably some optimizations they could code as well. But for now I'm just glad I know how to make it work. :)
WarpEnterprises
1st November 2002, 23:35
@Hakko et al:
Sh0dan implemented FadeIn (in the CVS-snapshot-version)
Thanks!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.