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.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 13 of 13
Thread
-
-
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.
Try this:
Code: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:
Code: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.
-
Pure garbage! (as you might say, manono )
Dissolve also cross-fades the audio, so sync is maintained.
(And in fact, fades are implemented internally in Avisynth using Dissolve with a blank clip.)
Before applying the script, the OP needs to fix the problems with the original files (eg with Avidemux as AlanHK suggests). -
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. -
Yes, that's right. The total frame count is reduced by the amount of the overlap.
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. -
I always use the zero in my Fadein/outs. Have you guys thought about fixing that? That is a bug, right, or might be there be a reason someone would want to change the total frame count when using Fades? Yeah, I know that extra frame is added so there's a black frame at the beginning and/or end. But still, it shouldn't be all that hard to do the fade over n-1 frames, and then add the black frame so the total number of frames remains constant.
-
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. -
The problem is once a function has been around for a while there are thousands of scripts that depend on it working that way.
If it's necessary to keep the frame count, I do
Trim(1,0).FadeIn(20)
Often the first frame is wacky anyway and it saves me having to do
FreezeFrame(0,1,1) -
I don't know if this was a bug (ie unintended) or simply a badly conceived design, but as AlanHK says, changing it now would alter the behaviour of existing scripts and the 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).
Of course, you have to remember that this effectively gives a 21-frame fade.
A 20-frame fade out, ending on black, is a bit more cumbersome:
Trim(0,Framecount-2).FadeOut(19)
Similar Threads
-
avisynth - how to fade in (but audio has to fade in faster)
By adom in forum EditingReplies: 13Last Post: 31st Jan 2011, 13:45 -
Fade in Fade Out CD Music Software
By mn072065 in forum ComputerReplies: 0Last Post: 6th May 2008, 09:23 -
Fade in Transition Fade out scenes
By ancient in forum Authoring (DVD)Replies: 4Last Post: 30th Nov 2007, 06:04 -
fade in/fade out with smart rendering
By bmf in forum Camcorders (DV/HDV/AVCHD/HD)Replies: 2Last Post: 10th Jun 2007, 14:33 -
Fade-in\Fade-out filter, VirtualDub MOD
By GangstaRap in forum Video ConversionReplies: 3Last Post: 21st May 2007, 21:58