带有字幕错误的AviSynth脚本

时间:2017-04-28 01:37:48

标签: ffmpeg avisynth

Win7的

FFmpeg版本:20170223-dcd3418 win32 shared

AVISynth版本:2.6

在Visual Studio 2015 C#Forms应用程序中调用ffmpeg并使用process.StartInfo.Arguments传递参数并读取avs脚本。工作正常。

avs脚本:

LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")

a=ImageSource("01.png").trim(1,24)
b=ImageSource("02.png").trim(1,36)
c=ImageSource("03.png").trim(1,40)
d=ImageSource("04.png").trim(1,72)
e=ImageSource("05.png").trim(1,36)
f=ImageSource("06.png").trim(1,40)
video =  a + b + c + d + e + f

return video

我想使用avs脚本添加字幕,但它不起作用。在“返回视频”参数之前添加字幕参数会导致:

subtitle("day 111", align=2, first_frame=0, halo_color=$00FF00FF, text_color=$0000FF00, size=36, last_frame=100)

结果错误:[avisynth @ 003cdf20]脚本错误:函数“subtitle”的参数无效

使用video.subtitle导致:

video.subtitle("day 111", align=2, first_frame=0, halo_color=$00FF00FF, text_color=$0000FF00, size=36, last_frame=100)

没有错误,脚本完成但输出视频没有字幕。

使用字幕(剪辑)会产生:

subtitle(video, "day 111", align=2, first_frame=0, halo_color=$00FF00FF, text_color=$0000FF00, size=36, last_frame=100)

脚本异常退出,但没有错误消息。

非常感谢任何指导。如果我能澄清任何事情,请告诉我。

1 个答案:

答案 0 :(得分:0)

谢谢,这很有效。

LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")

a=ImageSource("01.png").trim(1,24)
b=ImageSource("02.png").trim(1,36)
c=ImageSource("03.png").trim(1,40)
d=ImageSource("04.png").trim(1,72)
e=ImageSource("05.png").trim(1,36)
f=ImageSource("06.png").trim(1,40)

subtitle(a + b + c + d + e + f, "day 111", align=9, first_frame=0, halo_color=$00FF00FF, text_color=$0000FF00, size=36, last_frame=100)