Log in

View Full Version : Problem with audiodub/normalize


vcmohan
10th December 2007, 13:31
I am trying to edit my home video in which parts I want to speed up and also reduce the audio. This part is a clip recording of Grand Canyon during a helicopter tour.
The script used is as follows and monitoring with videodub
<code>
L1 = trim(0,3290)
L2 = trim(3480,3690)
DirectShowSource("E:\MayJune07\MayJ009.avi")
# 0 to 9400 To Hooverdam and Grand Canyon
C1 = trim(0,9400)
# 9415 to 33360 Grand Canyon
trim(9415,33360)
selectevery(3,0,1).assumeFPS("ntsc_round_video")

audio = killvideo().normalize(0.2)
c2 = audiodub(last,audio)
#c2 = last
DirectShowSource("E:\MayJune07\MayJ011.avi")
#0 to 6819 The strip contd.
L3 = trim(0,6819)
#return (l2)
L1 ++ L2 ++ L3 ++ C1 ++ c2
</code>
When the playback reaches c2 it gets stuck and I have to end task.
If I uncomment the second c2 line ( effectively bypassing killaudio and normalize then it runs ok.
By mistake first time i coded the line previous to first c2 as
<code>
audio = killaudio().normalize(0.2)
</code>
I did not get any error message (that I am joining clips one with audio and other without audio. It went through
but with audio being not what I wanted.
Why Avisynth did not catch this error? Why this behaviour with my script?

Leak
10th December 2007, 14:19
Why Avisynth did not catch this error? Why this behaviour with my script?
I'm pretty sure your "getting stuck" is just AviSynth decoding the audio up to the end at full tilt, as in order to normalize the volume level the Normalize filter needs to know the peak volume of the audio stream which it can only find out by decoding everything once.

And, of course, it can't return anything while doing that, so playback will be stuck until then... waiting until it finishes or using something else than Normalize will probably solve your problem.

IanB
10th December 2007, 21:31
As Leak points out Normalize read all of the audio in one hit and this can take quite a while.

Simplest solution is to add the Show=True option once note the value found and replace the Normalize() with an equivalent Amplify().

Also using Trim() to limit the range over which Normalize() will search can also be helpfull.