VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. 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)
    Quote Quote  
  2. 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)
    Quote Quote  
  3. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    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)
    }
    Note that I do repeated fades, as I want to have a very steep fade.
    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
    Quote Quote  
  4. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by Cherbette View Post
    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
    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.
    Quote Quote  
  5. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by AlanHK View Post
    Code:
    function AudioFadeOut(clip input, int "num_frames"){
     FadeOut0(input,num_frames)
    ...
    num_frames is a mandatory parameter of FadeOut0 etc, but you have made it an optional parameter to your functions. It would be better to make it mandatory (by removing the quotes from the name), or provide an appropriate default in each function.
    Quote Quote  
  6. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by Gavino View Post
    num_frames is a mandatory parameter of FadeOut0 etc, but you have made it an optional parameter to your functions. It would be better to make it mandatory (by removing the quotes from the name), or provide an appropriate default in each function.
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!