PDA

View Full Version : Please help with fade command


iparout
18th October 2005, 23:40
Hi.

I am a complete noob when it comes to scripting, so I need some help adding fade-in and fade-out effects on a video.

The source video (f:\capture-huffy.avi) has commercials, so I used the trim command to edit them out. Now, what I want to achieve is create fade-out and fade-in effects in each of the 3 segments of the video... However, when I add the FadeIO2 command at the end of the script, only the last segment fades out.

Is there an easy way to do what I want ?

My script is this :

# PLUGINS
LoadPlugin("c:\PixieDust\LoadPluginEx.dll")
LoadPlugin("E:\GORDIA~1\Msharpen.dll")
LoadPlugin("c:\PixieDust\dustv5.dll")
LoadPlugin("E:\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("E:\GORDIA~1\undot.dll")
LoadPlugin("E:\GORDIA~1\decomb.dll")
LoadPlugin("E:\GORDIA~1\KernelDeInt.dll")
#LoadPlugin("E:\GORDIA~1\dgbob.dll")
#LoadPlugin("E:\GORDIA~1\Convolution3d.dll")
#LoadPlugin("E:\GORDIA~1\FluxSmooth.dll")
#LoadPlugin("E:\GORDIA~1\TomsMoComp.dll")
#LoadPlugin("E:\GORDIA~1\VSFilter.dll")
#LoadPlugin("E:\GORDIA~1\SimpleResize.dll")

Avisource("f:\capture-huffy.avi")

Trim(22,72735) ++ Trim(73473,146131) ++ Trim(146304,148783)

# DEINTERLACING (2)
KernelDeint(order=1)

#CROPPING
Crop(18,12,-14,-12)

#DENOISE
PixieDust(5)

#SHARPEN
MSharpen()

#RESIZING
LanczosResize(640,480)

Any help would be much appreciated.

Thanks in advance.

P.S. : The avi file also has audio which I want to keep, so will adding 3 fade-ins and outs make the audio go off synch ?

gzarkadas
19th October 2005, 00:23
...Now, what I want to achieve is create fade-out and fade-in effects in each of the 3 segments of the video... However, when I add the FadeIO2 command at the end of the script, only the last segment fades out.
...
# PLUGINS
...
Trim(22,72735) ++ Trim(73473,146131) ++ Trim(146304,148783)
...

...
P.S. : The avi file also has audio which I want to keep, so will adding 3 fade-ins and outs make the audio go off synch ?

The line above in your code creates a single clip from the three. Adding FadeIO at the end of the script only fades at the limits of the (now) single clip; so it doesn't work as you want in any case.

So you will have to try in your script the following instead of the above line (this will also keep audio in sync):

ff = {enter the number of frames you want to fade}
audio = Trim(22,72735) ++ Trim(73473,146131) ++ Trim(146304,148783)
video = Trim(22,72735).FadeIO0(ff) ++ Trim(73473,146131).FadeIO0(ff) ++ Trim(146304,148783).FadeIO0(ff)
AudioDub(video, audio)

Now, if you really want the 2 extra black frames at the end add this line after the above (last function ensures the two frames are silent):

last + BlankClip(last).Trim(0, -2).AmplifydB(-30)

iparout
19th October 2005, 01:38
It works...

Thanks a lot.

stickboy
19th October 2005, 02:13
Now, if you really want the 2 extra black frames at the end add this line after the above (last function ensures the two frames are silent):

last + BlankClip(last).Trim(0, -2).AmplifydB(-30)
Just do:
last + BlankClip(last, length=2)Amplify/AmplifyDB shouldn't be necessary; BlankClip always should generate silent clips.