0

I wrote a script to write some text into a video clip with some effect is not clear how it work (but work)

        a=AVIFileSource("C:\downloads\FREE.avi")
#take file free.avi 
    ovText = "AviSynth Authors:"+chr(13)+
        \ "----------------------------"+chr(13)+

        \ ""
#variable ovText some text in
    c = 4000
# what shit is this c?
t_mask = messageclip(ovText, height=c).converttoyv12().coloryuv(levels="tv->pc").trim(0,1)
#and this? another variable

    t_blank = blankclip(t_mask, color=$ffffff)

    overlay(a, t_mask,x=199, mode="subtract")
    overlay(t_blank,x=200, mode="blend", mask=t_mask)

        frameevaluate("ol_x_offset = 400")
        frameevaluate("ol_y_offset = 256 - (current_frame)")

#this frameevaluate take current frame value and put it into overlays so y value became t value e position value. I have text that go up from frame 256   
    Crop(0,0,0,0,align=true)
    Spline36Resize(720,480)

Now I have a video in which there's some text that go up, now I would like that text go down when end some ideas?

1 Answers1

0

In your code c means the overlay clip height, it's big to provide space for a large number of lines in the text. Then that clip was overlayed on the main video clip at vertical offsets calculated from current frame index.

Here's a much simpler method using animate and subtitle:

ovText = "
AviSynth Authors:\n
----------------------------\n
"

AVIFileSource("C:\downloads\FREE.avi", pixel_type="YV12")

# scroll up
animate(0, 100, "showText",
\   ovText, width/2, height/2, 
\   ovText, width/2, -100)

# scroll down
animate(100, 200, "showText",
\   ovText, width/2, -100, 
\   ovText, width/2, height/2)

function showText(clip vid, string text, float x, float y) {
    vid.subtitle(text, x=x, y=y, size=20, text_color=$ffffff, align=5, lsp=1)
}
wOxxOm
  • 65,848
  • 11
  • 132
  • 136