View Full Version : Audio stream fade in / out script?
doctorjellybean
19th September 2003, 14:11
I have a video fade in/out script, can something similiar be done for the audio, so it fades in 1st 2 sec and out last 2 secs?
jorel
19th September 2003, 15:13
from what source?
ac3,wav...?
and the target?
mp2,wav...?
:)
doctorjellybean
19th September 2003, 17:39
Oops sorry :)
This is what I'm doing...opening VOB files with VirtualDub, selecting the start and end points, and then saving to AVI. I'm hoping that I could use such a script with the above process. If not, perhaps there is a better alternative? What I want to avoid is saving as an AVI file, and then having to edit with an external video editing app to do the fades and then re-render the whole file over again.
jorel
19th September 2003, 17:53
why don't a dvd2avi project for the vobs?
and the target is...?
mpeg(vcd,svcd)?...divx?...?
...i need more details to try to help you!
:)
doctorjellybean
19th September 2003, 18:34
The final target is a DivX encoded AVI. At the moment this is my current method :
Rip VOB from DVD with DVD Decrypter \ DVD2SVCD and save as VOB file.
Open VOB file with VirtualDub and select start and end points, saving as Huffyuv AVI.
Open AVI file with Vegas, apply audio and video fades, and save as Huffyuv AVI.
Open AVI with Dr DivX and encode as DivX AVI.
The reason why I don't open VOB is Vegas is because Vegas takes ages to open it, and I don't save as DivX encoded within Vegas because for some reason the quality of Dr DivX is better than the 5.1 codec.
jorel
19th September 2003, 19:55
is your choice but....
why this long road to got divx if dvd2svcd do
better job doing svcds to play in dvd players and in pc too?
:confused:
if you can get the audio as wave,you can
open this wave in ce or sound forge(or any wave editor)
and apply the fadein or fadeout.
then using BeSweetGUI or headac3he,encode the
"faded wave" as mp3.....!
i don't do divx but you need mp3 for divx,don't?
this is the easy way to get fade in audio(i think):
dvd2avi project and got the audio as ac3.
besweetgui or headac3he to encode this ac3 as wave.
take this wave to your audio editor,
use fade where you need and save.
back to besweetgui or headac3he and
encode the "faded wave" as mp3!
you will play your divx on pc but
svcd in the pc and in dvd players(tons of models)
will be better!
dvd2svcd do the "hard part" for you!
again i ask:
svcd with dvd2svcd isn't a better choice?
;)
doctorjellybean
19th September 2003, 20:05
The DVD's I'm ripping are music ones, hence the fades for each individual music clips (especially for concerts). Also, the final file will only be played on a PC. I chose DivX because not everybody has a Mpeg 2 codec. Your suggestion does make sense tho' :)
stickboy
19th September 2003, 22:10
Use a combination of FadeIn/FadeOut/FadeIO and AudioDub. For example, something along the lines of:v = AVISource("foo.avi") # or whatever your source is...
# fade-in the beginning and fade-out the end by two seconds
a = v.FadeIO(v.FrameRate() * 2)
# remove the extra frame at the beginning and the one at the end
# that FadeIO adds
a = a.Trim(1, -(a.FrameCount() - 2))
AudioDub(v, a)
doctorjellybean
19th September 2003, 23:16
Thanks stickboy :)
Am I correct in that I create an *.avs file and run it as a script from VirtualDub?
If yes, I've created an *.avs file :
v = AVISource("D\temp\test.avi")
# fade-in the beginning and fade-out the end by two seconds
a = v.FadeIO(v.FrameRate() * 2)
# remove the extra frame at the beginning and the one at the end
# that FadeIO adds
a = a.Trim(1, -(a.FrameCount() - 2))
AudioDub(v, a)
When I try to run this, VirtualDub gave an error :
Sylia script error
Variable not found
stickboy
20th September 2003, 09:33
Originally posted by doctorjellybean
v = AVISource("D\temp\test.avi")You're missing a ':' after the drive letter. Does your actual script have the correct path?
a = v.FadeIO(v.FrameRate() * 2)Oops. This should be:a = v.FadeIO(Int(v.FrameRate() * 2))
Sylia script error
Variable not foundThat's odd. I've never seen that before. (FWIW, Sylia is VirtualDub's internal scripting system and isn't related to AviSynth.)
Si
20th September 2003, 10:31
@doctorjellybean
Tell me if I'm wrong but have you actually installed and used Avisynth and a .avs script before?
If you haven't - have a look at www.avisynth.org (http://www.avisynth.org) - if you have - then sorry :)
regards
Simon
doctorjellybean
20th September 2003, 10:31
You're missing a ':' after the drive letter. Does your actual script have the correct path?
Yes, I have even put the script in same folder as AVI, same error message. Silly of me to forget the ':' :(
If I right-click on the *.avs file and select open with VirtualDub, VirtualDub starts up and display this in it's status bar :
Autoloaded 2 filters (0 failed)
When does the script actually kick in, because after saving the AVI there are no fades.
Thanks for all the help :)
doctorjellybean
20th September 2003, 10:41
yes siwalters I've AviSynth installed (2.5) :) I've not actually had the need before to use a script as I did the work in an external app, hence the need to use a script now to avoid the external app.
Si
20th September 2003, 12:25
I think you need to try the basics first before one of stickboys veru useful functions:)
Have a go with using a simple avs containg
Version()
return last
And see what happens
Then try
AVISource("D:\temp\test.avi")
return last
And see what happens.
BTW VirtualDub can't read VOB files but some variations can.
I know this might sound naff but its important to get the details right when asking for help :)
regards
Simon
doctorjellybean
20th September 2003, 12:59
I may be wrong, but I think there is a problem with stickboy's script. If I'm wrong, please accept my apologies :)
When I try your examples siwalters, it works. I created a test script :
AVISource("test.avi")
FadeIn(30)
FadeOut(30)
and that works, fading the first and last 30 video frames.
BTW VirtualDub can't read VOB files but some variations can.My variation is VirtualDub-MPEG2 1.5.4
Si
20th September 2003, 14:16
v = AVISource("D:\huffyuv.00.avi")
v=trim(v,0,500)
#
# fade-in the beginning and fade-out the end by two seconds
a = v.FadeIO(Int(v.FrameRate() * 20))
#
# remove the extra frame at the beginning and the one at the end
# that FadeIO adds
a = a.Trim(1, -(a.FrameCount() - 2))
#
AudioDub(v, a)
Gives me a slow audio fade up and down again - note mod for 20 secs.
Try it (replacing my source with yours)
I use VirtualDub 1.4.13 BTW :)
regards
Simon
doctorjellybean
20th September 2003, 14:38
That works...only the audio tho' :( I thought FadeIO fades both the video and audio? It also creates a clip of 20 secs? Would it perhaps have a connection with my version of AviSynth (2.5) ?
Thanks for all the help this far, it is much appreciated :cool:
Si
20th September 2003, 15:02
Your original question
I have a video fade in/out script, can something similiar be done for the audio :rolleyes:
note mod for 20 secs.
Stupid remark removed
regards
Simon
Si
20th September 2003, 15:29
Sorry - I was a bit unkind and I hadn't read all your posts :o
v = AVISource("D:\huffyuv.00.avi")
#
# fade-in the beginning and fade-out the end by two seconds
v = v.FadeIO(Int(v.FrameRate() * 2))
#
# remove the extra frame at the beginning and the one at the end
# that FadeIO adds
v = v.Trim(1, -(v.FrameCount() - 2))
#
return v
This modified script should provide a 2 sec fade in and out of both audio and video of your source avi.
To change the amount of time - alter the 2 value in the 2nd active line of the script.
The original clip lasted 20 secs due to the Trim line in it - I just used that so I didn't have to wait until the end of my source avi to see what happens :)
regards
Simon
doctorjellybean
20th September 2003, 16:46
Brilliant...that works :) Thank you for all the help!
doctorjellybean
22nd September 2003, 14:05
Sorry for being such a pain :o
Is it possible to pass on to the script the file name opened by VirtualDub? Let's say I open test.avi with VirtualDub, and then open the *.avs file with VirtualDub, that the script takes the AVISource as the file opened, rather than v = AVISource("test.avi"). That way I can create jobs and run it all at night. Thanks again :)
sh0dan
22nd September 2003, 15:14
I made this small web-based util:
http://www.avisynth.org/index.php?page=IntermediateTips
I takes a script (top window), and a filename list, and then creates one script for each filename, replacing "%filename" in the script with one of each of the filenames in the list.
doctorjellybean
22nd September 2003, 15:42
Very clever....thank you :)
I guess it's not possible to have this as a standalone generator, for e.g. there is no internet connection?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.