So far I have figured something like:
"BlankClip(last, length=20) + Trim(20,0)"
(>>see full script below for reference<<)
The "Trim" line is cutting my audio which I'd like to avoid. I basically would like to lay XX frames of black over the video only (without blanking that 20 frames of audio) then add XX seconds of fade in to the video only...then fade in the audio only for XX seconds. Hopefully that makes any kind of sense. The audio starts before the video (yes its properly in sync) so I want apply a short fade to the audio, black the frames and so on...All fadein/fadeout functions I've seen affect both audio and video.
vid=AviSource("the way of love.avi").AssumeTFF.converttoYV12(interlaced=true )
aud=wavsource("the way of love-cr.wav")
audiodub(vid,aud)
Trim(189,5005)
YtoUV( UtoY().selectevery(1,2), VtoY(), last )
mergechroma( awarpsharp2(depth=16,thresh=255,blur=3) )
#BadFrames(0, blend=true)
#StackHorizontal(vid, last)
MergeChroma(last,McTemporalDenoise(last, settings="medium", edgeclean=true, ecrad=3, stabilize=true, maxr=2, interlaced=true))
#MergeLuma(last,McTemporalDenoise(last, settings="low", edgeclean=true, ecrad=3, stabilize=true, maxr=2, interlaced=true))
BlankClip(last, length=20) + Trim(20,0)
ConvertToRGB32(matrix="Rec601",interlaced=true)
Crop(11,2,-9,-8).AddBorders(10,5,10,5)
+ Reply to Thread
Results 1 to 6 of 6
-
-
I've figured out how to do everything thus far except fade from the black frames to video without affecting the fade in I've applied to only the audio:
vid=AviSource("the way of love.avi").AssumeTFF.converttoYV12(interlaced=true )
aud=wavsource("the way of love-cr.wav")
audiodub(vid,aud)
Trim(189,5005)
video=last
audio=last.FadeIn(60)
#YtoUV( UtoY().selectevery(1,2), VtoY(), last )
#mergechroma( awarpsharp2(depth=16,thresh=255,blur=3) )
#BadFrames(0, blend=true)
#StackHorizontal(vid, last)
#MergeChroma(last,McTemporalDenoise(last, settings="medium", edgeclean=true, ecrad=3, stabilize=true, maxr=2, interlaced=true))
#MergeLuma(last,McTemporalDenoise(last, settings="low", edgeclean=true, ecrad=3, stabilize=true, maxr=2, interlaced=true))
BlankClip(video.KillAudio, length=20) + KillAudio.Trim(20,0)
audiodub(last,audio)
ConvertToRGB32(matrix="Rec601",interlaced=true)
Crop(11,2,-9,-8).AddBorders(10,5,10,5) -
I wanted to just fade audio quite a lot, (often after a Trim where a previous scene's audio continued) so I made a pair of functions, put it in an avsi in the plugins folder:
Code:function AudioFadeOut(clip input, int "num_frames") { num_frames = Default(num_frames,50) FadeOut0(input,num_frames) FadeOut0(last,num_frames) FadeOut0(last,num_frames) FadeOut0(last,num_frames) return AudioDub(input,last) } function AudioFadeIn(clip input, int "num_frames") { num_frames = Default(num_frames,50) FadeIn0(input,num_frames) FadeIn0(last,num_frames) FadeIn0(last,num_frames) FadeIn0(last,num_frames) return AudioDub(input,last) }
Also used "FadeIn0" so it doesn't add any extra frames.
A one-fade version, and adding video fades. Defaults 50 frames for each:
Code:function AudioFadeOut(clip input, int "num_frames") { num_frames = Default(num_frames,50) FadeOut0(input,num_frames) return AudioDub(input,last) } function AudioFadeIn(clip input, int "num_frames") { num_frames = Default(num_frames,50) FadeIn0(input,num_frames) return AudioDub(input,last) } function VideoFadeOut(clip input, int "num_frames") { num_frames = Default(num_frames,50) FadeOut0(input,num_frames) return AudioDub(last,input) } function VideoFadeIn(clip input, int "num_frames") { num_frames = Default(num_frames,50) FadeIn0(input,num_frames) return AudioDub(last,input) }
Last edited by AlanHK; 21st Jan 2012 at 00:23. Reason: added defaults
-
Instead of
BlankClip(video.KillAudio, length=20) + KillAudio.Trim(20,0)
use
BlankClip(video, length=20) + Trim(20,0).FadeIn0(40)
Note that KillAudio is unnecessary here, as the audio is later overwritten by AudioDub anyway.
I have used FadeIn0 instead of FadeIn to preserve the original length - to be consistent with that, you should change the earlier audio fade to use FadeIn0 too.
AlanHK's functions are neat, but they don't help you much because you want to add the 20 blank frames at the start, so need to process video and audio separately. -
-
Thanks, I wasn't aware the quotes meant it was optional.
A default would be nicer. I modded the code accordingly.
I usually write scripts by cannibalising and modifying code, faster but sometimes has side effects.
Every now and then I reread the references and pick up some points like this that didn't register earlier.Last edited by AlanHK; 20th Jan 2012 at 23:53.
Similar Threads
-
avisynth - overlay fadein from transparent
By doma79 in forum EditingReplies: 12Last Post: 6th Dec 2011, 11:38 -
AVISynth Question
By Alexstarfire in forum Newbie / General discussionsReplies: 6Last Post: 6th Jul 2010, 11:22 -
Avisynth Script Question
By MegaTonTerror in forum Video ConversionReplies: 4Last Post: 22nd Aug 2009, 21:28 -
AviSynth - JDL_ApplyRange() & FadeIn() Compatibility Issue?
By Typhoon859 in forum Video ConversionReplies: 18Last Post: 4th May 2009, 19:29 -
MKV, CCE and AviSynth Question
By Maikeru-sama in forum Video ConversionReplies: 10Last Post: 14th Jan 2008, 16:35