View Full Version : Fade In / Out Question
1gnition
1st June 2007, 13:40
Hello,
I'm processing a VHS cassette I captured using Avisynth. The video has a lot of scenes which end abruptly and followed by the next scene (filmed using a camcorder by an amateur). I want to improve it by locating fade in's / out's at these points. I reviewed the Avisynth command "Fade" and noticed that there isn't an parameter within the command to make "fades" in the middle of the video but only at the beginning and end.
Someone knows a way to do that?
gzarkadas
1st June 2007, 14:44
You will have to use Trim to cut your video to blocks, then use the Fade... commands on them (or maybe Dissolve) and join them back together.
You will have to use Trim to cut your video to blocks, then use the Fade... commands on them (or maybe Dissolve) and join them back together.
Yeah, Dissolve is most probably what he's looking for - I think "CrossFade" would have been a better name for it...
np: Vladislav Delay - I Saw A Polysexual (Whistleblower)
1gnition
1st June 2007, 15:59
I can't do that. I use Avisynth only once for framesevring to MPEG encoder. If I do what you say - It is several more steps:
1. To cut the video into blocks.
2. Apply the "Fade" command for each of them separately.
3. Combine with VirtualDub / Dissolve with Avisynth.
And what if I had to do it like 20 times?
Isn't there another solution? Maybe other program - not Avisynth?
I can't do that. I use Avisynth only once for framesevring to MPEG encoder. If I do what you say - It is several more steps:
1. To cut the video into blocks.
Yeah, well - you'd have to cut up your video for this anyway, or how did you expect it to work? Avisynth is a scripting language, after all, so you'll have to feed the script with frame numbers.
2. Apply the "Fade" command for each of them separately.
Dissolve does this automatically.
3. Dissolve with Avisynth.
Well, of course - again, how did you expect it to work?
And what if I had to do it like 20 times?
Dissolve(Trim(0-99),Trim(100-199),Trim(200-299),25)
would connect three segments of 100 frames each and crossfade them over 25 frames by overlapping their respective starts and ends. The same would work for 20 segments, of course.
np: Håkan Lidbo - Call For Islam (Dunka Dunka)
1gnition
1st June 2007, 17:28
You guys are supposedly right!
But I found A program which does all of this at once!
AVSCutter (http://www.ecs.fh-osnabrueck.de/avscutter.html), which generate an AVS script that looks like that:
#------------------------------------------------------
# source related parameters
#------------------------------------------------------
source_framerate=25
source_width=720
source_height=568
#------------------------------------------------------
# import the source
#------------------------------------------------------
# Enter your AviSynth-commands here to specify
# the source video stream, e.g:
# AviSource("D:\Full\Path\Name\VideoSource.avi")
SegmentedAVISource("d:\vhs\capture.avi")
converttorgb(interlaced=true)
source=last
#------------------------------------------------------
# define the clips
#------------------------------------------------------
# Clip8: Chapter1
source.trim(109,9885)
Clip8=last
# Clip9: Chapter2
source.trim(9894,36420)
Clip9=last
# Clip11: Chapter3
source.trim(36421,68847)
Clip11=last
# Clip13: Chapter4
source.trim(68847,88341)
Clip13=last
# Clip14: Chapter5
source.trim(88342,97309)
Clip14=last
# Clip15: Chapter6
source.trim(97524,102512)
Clip15=last
# Clip17: Chapter6(2)
source.trim(102631,103113)
Clip17=last
# Clip19: Chapter7
source.trim(103114,110367)
Clip19=last
# Clip20: Chapter8
source.trim(110516,145395)
Clip20=last
# Clip21: Chapter9
source.trim(145676,148032)
Clip21=last
#------------------------------------------------------
# assemble the film
#------------------------------------------------------
Film=Clip8
Left=Film
Right=Clip9
# Transition0
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip11
# Transition1
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip13
# Transition2
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip14
# Transition3
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip15
# Transition4
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip17
# Transition5
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip19
# Transition6
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip20
# Transition7
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
Left=Film
Right=Clip21
# Transition8
Framecount_Left=Framecount(Left)
Transition_Length=80
Transition_Start = Framecount_Left - Transition_Length/2
Left.FadeOut(40, $0) + Right.FadeIn(40, $0)
Film=last
# Finally output the film
Film
#------------------------------------------------------
# add trailor commands
#------------------------------------------------------
# You may enter some final AviSynth commands
# for the resulting film, e.g. format conversions:
# ConvertToYV12(interlaced=true)
Please check it out.
Also - should I put the denoisers / chroma reduction filters and etc. before or after this script?
foxyshadis
2nd June 2007, 06:01
You probably would get the most benefit out of denoisers before any processing, but you probably won't notice much difference really. Levels, saturation, etc, can go anywhere, but if each scene has different needs, it'll have to go before fading. Up to you. Deinterlacing absolutely must be before fading, or it'll look terrible.
You're sure you want a fade-to-black every scene, instead of a few crossfades with dissolve? Mixing the two with sharp transitions often looks more natural - old movies are great at this. (Though no one will heckle you as long as you avoid the powerpoint transitions.)
1gnition
2nd June 2007, 13:32
I didn't explained everything in the topic, but the main reason I wanted fade in / out in the middle of the video is because at these locations I wanted to divide to DVD chapters. The dissolve effect is good when you make a transition between the scenes but I actually talk about chapters.
The AVSCutter has also an option for dissolve and custom transition. This is a wonderful software and is exactly suitable for this need.
As for deinterlacing - I author a DVD to play on a DVD player so I don't need to deinterlace.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.