VideoHelp Forum




+ Reply to Thread
Results 1 to 15 of 15
  1. Hi. I've a couple of conversions to do where an audio fadeout would be nice. I thought this would have been fairly easy but apparently not – seems the 'official' fadeout method also affects the video which is not what I want:
    http://avisynth.nl/index.php/Fade
    However, I found a function elsewhere on this forum:

    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)
    }
    and it works but not, in my experience, perfectly. Instead of fading to the end, it leaves a few seconds of silence at the end of the new video i.e. it fades to silence too early. Does anyone know of a method for achieving true 'fade to end' of the audio? Thank you.
    Quote Quote  
  2. If you want a linear fade call FadeOut0() only once.
    Quote Quote  
  3. Perfect, thanks so much jagabo. The chap who wrote that function said of it "Note that I do repeated fades, as I want to have a very steep fade." I wonder why he just doesn't change the default, as I did, from 50 to 200 which gives me an 8 second fade. Thanks again, you're a pal.
    Quote Quote  
  4. Here's an image of audio faded over 5 frames with FadeOut0(5):

    Click image for larger version

Name:	single.png
Views:	189
Size:	11.0 KB
ID:	41789

    As you can see it fades linearly from full amplitude at the left, to zero amplitude at the right (before the fade it was full amplitude across the entire image). But after four consecutive FadeOut0(5) you get a much steeper drop at the start:

    Click image for larger version

Name:	four.png
Views:	190
Size:	6.8 KB
ID:	41790
    Quote Quote  
  5. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Yes, I remember, overlaying several fades produces an effect like a logarithmical fade which is closer to the subjective loudness impression.

    Linear: 100% - 80% - 60% - 40% - 20% - 0%

    Logarithmic: 1 - 1/2 - 1/4 - 1/8 - 1/16 - 1/32

    Multiple linear fading is not the same as logarithmic. But try 2 or 3 instead if 4 were too steep. Until maybe someone creates other non-linear volume change functions for AviSynth (I doubt Animate("AmplifydB") will work well on the audio part, due to video frame granularity).
    Quote Quote  
  6. Thanks guys. I much prefer my linear fade...
    Quote Quote  
  7. If anybody's interested, I hacked up the four main types of fadeout --
    (I say "hacked" because they are piecewise approximations, not true curves, but they seem to work alright)
    They're mainly for audio, but you can fade video only, audio-only, or both. Fade to black or any other color.

    Script is here (dropbox)

    Linear (the normal Avisynth fade):


    Exponential (fast at first, then a long fadeout):


    Studio (slow, medium, slow):


    Logrithmic (slow, fast):


    EDIT - an example:
    Code:
    Fade_stu(1999, 2029, vfade=false) # afade=true (default)
    ## "studio" fadeout
    ## audio fade only
    ## fade starts at frame 1999
    ## fade completed at frame 2029 (30 frames later)
    ## clip continues silent to the end
    Last edited by raffriff42; 4th Jun 2017 at 11:40. Reason: new link
    Quote Quote  
  8. Looks like a lot of work went into that, raffriff42...
    Quote Quote  
  9. Originally Posted by pooksahib View Post
    Looks like a lot of work went into that, raffriff42...
    Yeah, no doubt. It was a fun little project.
    Quote Quote  
  10. Anonymous344
    Guest
    Thanks, raffriff42! This thread is related and might interest you.
    Quote Quote  
  11. hello you guys,
    I was looking for a very easy way to easily Audio only fade in and fade out each segment within an easy trim section. For example like this

    Fade=30
    #Trim(0,1000).FadeAudioIn(Fade).FadeAudioOut(Fade) ++ \
    #Trim(2000,3000).FadeAudioIn(Fade).FadeAudioOut(Fa de) ++ \
    #Trim(8000,0).FadeAudioIn(Fade).FadeAudioOut(Fade)

    the video already contains fadein and fadeouts and I don't want to extend theese/black out more frames. So audio only would be ideal in this case to make everything more smooth and not so appruptley. raffriff42 function https://github.com/raffriff42/AvisynthPlusUtilities/blob/master/Utils-r42.avsi sounded perfect but I have no idea how to implement that into my logic. thanks in advance for your help
    Last edited by skh; 25th Jul 2025 at 03:10.
    Quote Quote  
  12. I figured it out a bit but it applies the fades to the video too sadly

    Trim(0,1996).UUFadeAV(Fade,Fade)++ \
    Trim(4356,15840).UUFadeAV(Fade,Fade)++ \
    Trim(19419,24070).UUFadeAV(Fade,Fade)++ \
    Trim(27601,0).UUFadeAV(Fade,Fade)
    Quote Quote  
  13. hmm it could be that the difference modes used in the no longer available Fade_stu are not a part of the posted Utils-r42.avsi
    did anyone back that up as it is no longer online
    Quote Quote  
  14. Originally Posted by skh View Post
    I figured it out a bit but it applies the fades to the video too sadly

    Trim(0,1996).UUFadeAV(Fade,Fade)++ \
    Trim(4356,15840).UUFadeAV(Fade,Fade)++ \
    Trim(19419,24070).UUFadeAV(Fade,Fade)++ \
    Trim(27601,0).UUFadeAV(Fade,Fade)
    Use AudioDub() to apply the faded audio to the original video.
    Code:
    vid = last # remember original video
    (apply your fades here)
    AudioDub(vid, last)  # restore original video
    Quote Quote  
  15. As always .. there is nothing wrong with my environment
    Quote Quote  



Similar Threads

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