VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    Jan 2010
    Location
    Australia
    Search Comp PM
    Hello all.

    I've been reading this site, and Doom9, a lot while trying to do some video editing and encoding the past week. I've set up and mostly got my mind around MeGUI and the various codecs and terms.

    Right now, what I need to do is create some fade-ins and fade-outs. I worked out how to do this in AviSynth, fading out at the end, but what would I change if I wanted it to say, fade to black at 02:00, and slowly fade back into the video at 02:05?

    And during that time I want to superimpose some text on the screen (say, "Five years later"). Is there a command that amounts to "Put 'five years later' on the screen in white Helvetica, centered horizontally and vertically, starting at 02:00 and lasting 10 seconds"?

    I know this is kind of noobish and someone will probably say "just google it" (and I have), but I would really appreciate a bit of help here.

    I don't mind downloading extra software to do this if need be.

    Thanks to anyone who can offer tips.
    Quote Quote  
  2. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    Look at the avisynth guide for details, however the main items you need to read up on to do what you want ate

    Trim() to isolated sections of footage for applying affects
    FadeIn() and FadeOut() to add your fades
    Subtitle () to add your text

    Something like the following

    Trim(0, 240).Fadein(16).FadeOut(8)+Trim(240,0).FadeIn(8)

    Isolates the first 240 frames, fades in over the first 15 frames, fades out over the last 8 frames, then fades the rest of the clip in over the next 8 frames and plays out to the end.

    You might also look at AvsP to simplify coding and give you a real time preview
    Read my blog here.
    Quote Quote  
  3. You can divide the clip up, and use fadeio (fade in / out) or one of it's derivatives to fade "clip a" out into "clip b"
    http://avisynth.org/mediawiki/Fade

    You can use subtitle() to overlay text, change the fonts, sizes, colors etc..
    http://avisynth.org/mediawiki/Subtitle

    Another way to do this is the overlay() command, and using an image with transparency prepared in photoshop, for example

    AvsP is highly recommended as an editor and preview application


    OOPS, I guess guns beat me to the punch
    Quote Quote  
  4. Member
    Join Date
    Jan 2010
    Location
    Australia
    Search Comp PM
    Thanks guys, the links are handy and I appreciate the quick replies.

    I'm playing with AvsP now, and it's a huge timesaver. But I'm not totally sure how to specify which frames I want the subtitle to go over.

    I tried:

    trim(0, 480).subtitle("these are words", font="verdana", text_color=$ffffff, size=24)

    But that trimmed the entire clip down to 480 frames, then put a subtitle over all of it. Which part exactly says "Apply this effect from frame 400 to 500"?

    I'd also like to apply the KillAudio function to only certain parts, so this would be doubly handy.
    Quote Quote  
  5. Use trim() to divide up your video

    eg

    Code:
    a=AVISource().Trim(0,100)
    
    b=AVISource().Trim(101,200).subtitle("these are words", font="verdana", text_color=$ffffff, size=24) 
    
    c=AVISource().Trim(201,300)
    
    a++b++c
    In this example, the video is divided into 3 parts, a,b,c correpsonding to frames 0-100, 101-200, 201-300, respectively. The section 101-200 has the subtitle part.

    Another way to do this is to use stickboy's functions and use applyrange
    http://avisynth.org/stickboy/

    Can you clarify what you want to do with killaudio() ?
    Quote Quote  
  6. Member
    Join Date
    Jan 2010
    Location
    Australia
    Search Comp PM
    Ohh, I get it now. Thanks, I'll go have a try.

    With killaudio, I was hoping to just mute sections.

    I've got a video where I want to mute 1:00 to 1:15, make it black with a subtitle on top, then fade in. My video has 4 sections where this happens.
    Quote Quote  
  7. Member
    Join Date
    Jan 2010
    Location
    Australia
    Search Comp PM
    Just one more question... I've read the subtitle page, but I'm still not certain how to get multi-line subtitles in there. It says I need to set the LSP parameter, but to what, and where?

    Once I've set it, I'd use \n where I want the line break, right? Such as:

    lsp=5
    To be, or not to be \n
    That is the question
    Quote Quote  
  8. You could always create a real subtitle and burn it into the video whereever wanted. It'll save doing a trim specific for the subtitle (unless you go the ApplyRange route).

    As for the black sections, you could do the fadeout/in into/out of a black BlankClip added in where needed:

    http://avisynth.org/mediawiki/BlankClip
    Quote Quote  
  9. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    EDITED to correct errors 9/1/10

    Originally Posted by doublefox
    Which part exactly says "Apply this effect from frame 400 to 500"?
    Code:
    Subtitle ("these are words", size=40,  font="verdana", text_color =$ffffff, first_frame=400,  last_frame=500)
    See http://avisynth.org/mediawiki/Subtitle for all the parameters.

    But for more elaborate effects, see http://avisynth.org/mediawiki/External_filters#Subtitling
    You can use e.g., Textsub, (see http://avisynth.org.ru/docs/english/externalfilters/vsfilter.htm) and then load a standard ASS or SRT subtitle.

    Originally Posted by doublefox
    I'd also like to apply the KillAudio function to only certain parts, so this would be doubly handy.
    Then you will have to divide it up with Trims:

    Code:
    Trim(0,100) ++\
    Trim(101,400).Amplify(0) ++\
    Trim(401,600) ++\
    Trim(601,700).Amplify(0) ++\
    Trim(701,0)
    And you could do the subtitling as part of this if you prefer by "dotting" them onto the appropriate Trim line instead of using first_frame, last_frame.
    Quote Quote  
  10. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by doublefox
    Just one more question... I've read the subtitle page, but I'm still not certain how to get multi-line subtitles in there. It says I need to set the LSP parameter, but to what, and where?

    Once I've set it, I'd use \n where I want the line break, right? Such as:

    lsp=5
    To be, or not to be \n
    That is the question

    Originally Posted by Avisynth wiki
    Multi-line text using "\n" is added in v2.57 and it is used if the lsp (line spacing) parameter is set. It sets the additional line space between two lines in 0.125 pixel units.
    Code:
    Subtitle ("To be, or not to be\nThat is the question", lsp=0, size=40,  font="verdana", text_color =$ffffff, first_frame=400,  last_frame=500)
    Increase lsp if you want more space between the lines.
    Quote Quote  
  11. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by AlanHK
    Originally Posted by doublefox
    I'd also like to apply the KillAudio function to only certain parts, so this would be doubly handy.
    Then you will have to divide it up with Trims:

    Code:
    Trim(0,100) ++\
    Trim(101,400).KillAudio() ++\
    Trim(401,600) ++\
    Trim(601,700).KillAudio() ++\
    Trim(701,0)
    And you could do the subtitling as part of this if you prefer.

    or equivalently, using RemapFrames from http://avisynth.org/stickboy/
    Code:
    filtered = KillAudio() 
    ReplaceFramesSimple(last, filtered, mappings= \
    "[101	400]
     [601	700]")
    which is a much tidier way to apply filters to various sections of a file.
    I don't think it's possible to apply KillAudio to just part of a clip, since you can't join sections with audio to a section without. Instead of KillAudio(), use Amplify(0.0)
    Quote Quote  
  12. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by Gavino
    I don't think it's possible to apply KillAudio to just part of a clip, since you can't join sections with audio to a section without. Instead of KillAudio(), use Amplify(0.0)
    Right, sorry about that.
    Quote Quote  
  13. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Also, I forgot that ReplaceFramesSimple does not process audio, so you will have to do it the longer way using Trim.
    Quote Quote  
  14. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by Gavino
    Also, I forgot that ReplaceFramesSimple does not process audio, so you will have to do it the longer way using Trim.
    Hadn't noticed that -- seems more like a bug than a feature.
    I adjusted my scripts accordingly.

    Audio is a bit of an afterthought in Avisynth, though there are some useful functions and filters.
    Quote Quote  



Similar Threads

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