VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. Well, I have yet another small question about avisynth, except this one is much simpler in my opinion.

    Basically I am wanting to add a soundclip on top of any audio that might already exist at a specified time interval.


    Is there some kind of function or plugin that would allow me to do this easily? If there is not one I'm guessing I will have to add some silence before the audio clip and then mix the two audio files together?

    Thank You,
    Adam
    Quote Quote  
  2. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    http://avisynth.org/mediawiki/MixAudio

    But yes, only mixes the entire track, no offset.

    Use Tone() to generate some silence:
    http://avisynth.org/mediawiki/Tone


    But you need a video track to use most functions, so maybe BlankClip would be simpler

    Code:
    #Overlay Comments.mp3 (length 1000 frames) starting at 2000 frames offset.
    AviSource ("Original.avi")
    voiceover=BlankClip(last,2000) ++BlankClip(last, 1000).AudioDub(DirectShowSource("comments.mp3")))
    MixAudio(last,voiceover)
    Need to calculate the durations in frames; there are ways to do that in Avisynth if you need to do it often.
    Last edited by AlanHK; 13th Jul 2010 at 21:48.
    Quote Quote  
  3. Yes, but that only allows you to specify volumes, not actual time positions. That was what I was going to use if such a function doesn't exist.
    Quote Quote  
  4. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    I expanded my answer, see revised post.
    Quote Quote  
  5. Okay, that was quite informative. Thank you for your assistance.
    Quote Quote  
  6. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by AlanHK View Post
    But you need a video track to use most functions, so maybe BlankClip would be simpler

    Code:
    #Overlay Comments.mp3 (length 1000 frames) starting at 2000 frames offset.
    AviSource ("Original.avi")
    voiceover=BlankClip(last,2000) ++BlankClip(last, 1000).AudioDub(DirectShowSource("comments.mp3")))
    MixAudio(last,voiceover)
    The voiceover clip doesn't need a video track, so you can just use:
    Code:
    #Overlay Comments.mp3 (length 1000 frames) starting at 2000 frames offset.
    AviSource ("Original.avi")
    voiceover=DirectShowSource("comments.mp3")
    Trim(0, 1999)++Trim(2000, 2999).MixAudio(voiceover)++Trim(3000, 0)
    A more serious problem with your version is that the sound track outside the voiceover section would be reduced in volume by 50% (since mixed with silence).
    Quote Quote  
  7. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by Gavino View Post
    A more serious problem with your version is that the sound track outside the voiceover section would be reduced in volume by 50% (since mixed with silence).
    Right. Your method is better.*
    Sorry you have to keep correcting me.

    Actually, the only times I really use Avisynth mixing is to downmix to stereo or mono.

    For overlaying commentary tracks I use Audacity; so I was thinking like that, as mixing silence + track in Audacity causes no change in volume.

    Perhaps this method, which I actually use, might be helpful:

    For some TV shows I found a full-length podcast commentary online; if I cue it right it applies to what you see on screen. So I export the audio from the video, and then in Audacity use the "Compressor" filter to knock the volume down to -29 dB (works for me); then add the commentary track; mix them to make an alternate audio track. The original audio is still audible in the background but the commentary is clear.

    * Though one possible problem with dubbing a bare mp3 is that if it's VBR, it quickly gets out of sync -- Avisynth doesn't know how long it really is. If CBR then it's okay. I use CBR MP3 for patching audio (replacing advertising VO with music on TV shows, for instance).
    Last edited by AlanHK; 14th Jul 2010 at 07:59.
    Quote Quote  
  8. Thank You both. I will probably just use audacity for a little bit, but I may tweak around with the suggested avisynth code, and see where it brings me.
    Quote Quote  



Similar Threads

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