Log in

View Full Version : fadeio and overlay


rob[doom9.it]
17th October 2006, 09:01
hi :)
I want to put a fadeio logo on an avi..

I have tried this script but the fadein effect starts with the film and the logo dissolves at 39sec. (whatever I write in brackets)

video=AVISource("path").assumefps(25)
logo=imagesource("path",fps=25).fadein(xx).fadeout(xx)
v=overlay(video,logo,X_OFFSET,Y_OFFSET,opacity=0.8,mode="blend")

what is wrong?
thanks,

Rob[doom9.it]

Didée
17th October 2006, 09:40
Try this:

off_1 = 1 # Fade-in will start this much frames into the video
off_2 = 1 # Fade-out will end this much frames before vid's end
fade_in = 25 # Length of fade-in
fade_out = 40 # Length of fade-out

video = AVISource("path").assumefps(25)
frmcnt = framecount(video)
logo = imagesource("path",fps=25)
logo = logo.trim(1,1).loop(frmcnt-off_1-off_2-2).fadein(fade_in).fadeout(fade_out)
vstart = v.trim(0,-(off_1+1))
vend = v.trim(frmcnt-off_2,0)
vmdle = overlay(video.trim(off_1,frmcnt-off_2),logo,X_OFFSET,Y_OFFSET,opacity=0.8,mode="blend")
v = vstart ++ vmdle ++ vend
Not tested, so "may contain nuts". Also, there's a good chance of an "off-by-one" error ;) - but you get the idea.
edit: something is wrong for sure ...

This' a thread for AS usage, BTW, not for development.

rob[doom9.it]
17th October 2006, 10:07
Thanks :)
This' a thread for AS usage, BTW, not for development.
Sorry, I have read "Advance topic" in the description..

stickboy
17th October 2006, 16:45
Try using FadeIO on a mask instead.

I have an example you can look at: logo-example.zip (http://www.taenarum.com/avisynth/etc/logo-example.zip)