Log in

View Full Version : FadeOut for Audio.


super_dubukku
31st October 2007, 08:37
FadeOut works on both video & audio. Is there a way to fade out audio alone and keep video as it is ?

Thanks,

IanB
31st October 2007, 10:46
AudioDub(Last, FadeOut(25))

sidewinder711
8th June 2008, 13:48
I created a slideshow with several still pictures from my camera. Now I would like to insert some music to it and do a FadeOut only on the music.

My script:
video= ...#bunch of images inserted with ImageReader (length 45sec)
audio= NicMPG123Source("blah.mp3") #(length 3min)

1.I tried the above like
- AudioDub(video, FadeOut(25)) #error msg... no audio
- AudioDub(video, audio.FadeOut(25))

Unfortunately these scripts aren't doing the trick.


2.I searched in the forum and I found and tried separately the following two scripts:
a) #FadeIn works!
# fade-in the beginning by 25 seconds
a1 = audio.FadeIn(Int(video.FrameRate() * 25))
AudioDub(video, a1)

b) #FadeOut doesnt work!
# fade-out at the end by 25 seconds
a2 = audio.FadeOut(Int(video.FrameRate() * 25))
AudioDub(video, a2)


FadeIn works, but FadeOut doesn't do anything. Do I need to trim the audio beforehand and if so, how ?

Any help is much appreciated.

Wilbert
8th June 2008, 15:35
Afaik FadeOut (and FadeIn) doesn't work on an audio only clip. It needs to contain video. Try this:

video = ...#bunch of images inserted with ImageReader (length 45sec)
audio = NicMPG123Source("blah.mp3") #(length 3min)
nr_frames = int(video.FrameRate() * 25)
c = AudioDub(video, audio)
AudioDub(c, c.FadeOut(nr_frames))

In the resulting clip, the video is taken from "c" and the audio from "c.FadeOut(25)".

Above script is the same as what IanB posted:

video = ...#bunch of images inserted with ImageReader (length 45sec)
audio = NicMPG123Source("blah.mp3") #(length 3min)
nr_frames = int(video.FrameRate() * 25)
AudioDub(video, audio)
AudioDub(FadeOut(nr_frames))


I think that you need to trim the audio first to 45 seconds.

sidewinder711
8th June 2008, 16:11
Great, Wilbert... this is doing the trick, much appreciated! :thanks:

IanB
9th June 2008, 05:05
If there is no video track Fade*() and Dissolve() all assume for timing purposes a default FPS=24. For precise audio work you can set FPS=1000 and the numbers will become milliseconds.

In your case Wilbert solution is correct. You want the audio events synchronized to your video track, so bind them together with AudioDub() first.