Hi there. I have two files that I need to join together, and then fade out at the beginning, then at the end. The issue here is that I have this script in AVISynth...
The problem is that I cannot get anything to render in VirtualDub as the rendering process refused to start. Any help would be great. I want to avoid using WMM as having the resulting video in WMV format will make it pretty difficult to burn in subtitles later in VirtualDub. Both videos are in Xvid format at 1152x720 at 35 frames per second. Both clips when loaded individually showed a warning that they have a non zero starting time.Code:a = DirectShowSource("Epic2Lv3.avi") b = DirectShowSource("Epic2Lv4.avi") FadeIn(a,35) FadeOut(b,35) Dissolve(a,b,35)
I can't even get the script to load a video using VLC or WMP.
+ Reply to Thread
Results 1 to 13 of 13
That should render. But it probably doesn't do what you intend.
The fades will be ignored as you then call the oriignal a and b in the Dissolve.
a = DirectShowSource("Epic2Lv3.avi").FadeIn(35) b = DirectShowSource("Epic2Lv4.avi").FadeOut(35) Dissolve(a,b,35)Both clips when loaded individually showed a warning that they have a non zero starting time.
1. remux the files to make sure you timestamps are okay otherwise "when loaded individually showed a warning that they have a non zero starting time." might cause problems.
2. try something like:
a = AviSource("clip1.avi") //needs vfw decoders, alternatively use ffmpegsource or you really need DirectShowSource b = AviSource("clip2.avi") //needs vfw decoders, alternatively use ffmpegsource or you really need DirectShowSource af = FadeIn(a,35) bf = FadeOut(a,35) return Dissolve(af,bf,35)
AlanHK was faster
Last edited by ArcheKruz; 28th Jul 2011 at 03:53.
Using dissolve changes the total frame count and accounts for the audio going out of synch (or being truncated). If, instead of a dissolve, you just fade out and then fade back in, the audio should stay in synch.
Oh, he mentioned (and I echoed) the audio being truncated. I figured it got truncated because he kept it in the script during the dissolve. So that's not true?
I handle my audio separately and after using a dissolve the audio is no longer in synch. True, right? Because the frame count of the two clips and the dissolve is less than the frame counts of just the 2 clips added together, right? So I also figured he was at least attempting to correct the problem by adding the audio in afterwards.
Anyway, thanks for the correction.
If processing audio in the script, the audio is also cross-faded over the same amount of time, so it stays in sync.
But if you process the audio separately, then the lengths will no longer match.
In that case, as you suggest, it might be preferable to use a fade out and in instead of Dissolve.
Be careful here too though, since you have to use the FadeOut0 and FadeIn0 variants, as normal FadeOut/In adds an extra frame.
Avidemux has a few options that may straighten the file out.
Audio/Build VBR Time map
Tools/rebuild I & B frames
If it then plays in Avidemux correctly, copy/save as before, to a new AVI file.
In Avisynth, I always try AviSource() to source AVI files first.
If that has problems, then FFmpegsource2() or finally DirectShowSource().
To keep sync with VBR audio, use EnsureVBRMP3sync() (not needed for FFmpegsource2).
Anyway, the script I gave before does work, I tried it. The problem is with your files.
If it's necessary to keep the frame count, I do
Often the first frame is wacky anyway and it saves me having to do
Avisynth developers strive to maintain backwards compatibility. I guess that's why FadeIn0, etc, were introduced in v2.56 (although they don't quite do what your suggested fix would, since they don't have a completely black frame).
A 20-frame fade out, ending on black, is a bit more cumbersome: