VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    I have the following script in Avisynth. It generates two frames with two subtitles. One subtitle changes the text and the second subtitle is shown in both frames, unchanged. What I need is to show the second subtitle (ABC) only in the first frame. How can I do that?

    Code:
    BlankClip(width=640, height=360, length=1, fps=1, color=$FFFFFF)
    Subtitle("123", size=100, x=320, y=290, align=2, text_color=$0000ff) \
    ++ Subtitle("456", size=100, x=320, y=290, align=2, text_color=$0000ff)
    Subtitle("ABC", size=100, x=620, y=360, align=3, text_color=$000000)
    I am using Avisynth+ 3.7 on Windows 8.1 64 bit
    Quote Quote  
  2. One way is to make 2 different frames (exclude "ABC" from the 2nd), then splice (append temporally)

    Code:
    BlankClip(width=640, height=360, length=1, fps=1, color=$FFFFFF)
    Subtitle("123", size=100, x=320, y=290, align=2, text_color=$0000ff)
    Subtitle("ABC", size=100, x=620, y=360, align=3, text_color=$000000)
    a=last
    
    BlankClip(width=640, height=360, length=1, fps=1, color=$FFFFFF)
    Subtitle("456", size=100, x=320, y=290, align=2, text_color=$0000ff)
    b=last
    
    a+b
    Quote Quote  
  3. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    Thank you, it works.
    But what can I do when I have 30 such frames? Some of them have a second line and some of them don't have it. Should I keep defining variables c,d,e,f etc?
    Quote Quote  
  4. It's just one way to approach this problem. You can use other names for variables if you want to - often descriptive names can help with organization

    There might be some simpler way, if you had some overlap or similar text, but none of the text is the same between your 2 frames in that example


    Other options are video editors, NLE's . Many people feel it's easier to work in a GUI based NLE
    Quote Quote  
  5. Make yourself a little function that appends a frame with two optional subs, then call as wanted:

    Code:
    function AppendSubs(clip v, string "sub1", string "sub2")
    {
        BlankClip(v, length=1, color=$FFFFFF)
        Subtitle(sub1, size=100, x=320, y=290, align=2, text_color=$0000ff)
        Subtitle(sub2, size=100, x=620, y=360, align=3, text_color=$000000)
    
        v+last
    }
    
    BlankClip(width=640, height=360, length=1, fps=1, color=$FFFFFF)
    AppendSubs(last, "AAA", "111") # show both subs
    AppendSubs(last, "BBB", "") # show only the first sub
    AppendSubs(last, "", "333") # show only the second sub
    AppendSubs(last, "", "") # show no subs
    Quote Quote  
  6. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    Awesome, thanks a lot!
    I find Avisynth much better for such tasks than NLE editors
    Quote Quote  



Similar Threads

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