0

我写了一个脚本来将一些文本写入视频剪辑中,并不清楚它是如何工作的(但工作)

        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)

现在我有一个视频,其中有一些文字会上升,现在我希望在结束一些想法时该文字会下降?

4

1 回答 1

0

在您的代码c中意味着覆盖剪辑高度,为文本中的大量行提供空间很大。然后该剪辑以从当前帧索引计算的垂直偏移量覆盖在主视频剪辑上。

这是一个更简单的方法,使用animateand 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)
}
于 2015-07-29T11:15:34.773 回答