https://github.com/HomeOfVapourSynthEvo ... SFilterMod 看看特效會不會消失……KazamaSion 写了:不支持bord?
https://github.com/HomeOfVapourSynthEvo ... SFilterMod 看看特效會不會消失……KazamaSion 写了:不支持bord?
没问题了,谢谢Holy 写了:https://github.com/HomeOfVapourSynthEvo ... SFilterMod 看看特效會不會消失……KazamaSion 写了:不支持bord?
嗯,之前用了Subtext,会先在Aegisub里调用libass对一下效果,比较麻烦些。Holy 写了:改用 https://github.com/HomeOfVapourSynthEvolution/VSFilter 這個一般版的 VSFilter 看看,或者試試 http://www.vapoursynth.com/doc/plugins/ ... ml#subtext,現在已經預設自動將字幕 blend 到輸入視頻上了……雖然 libass 的 typesetting 呈現結果跟 VSFilter 不完全一致。
No ass file, no debug.巴洛克哥特 写了:貌似发现了一个bug,在1080P/720P下没问题,缩放为576P及一下分辨率再添加字幕,字幕位置会出错,如图:
在 AviSynth 內試了下位置一樣會偏移,或者在 Aegisub 內開個 1024x576 的 Dummy Video 看也是一樣,但是將 Aegisub 的 Subtitle provider 從 xy-vsfilter 改成 libass 看就沒有位置偏移問題……所以這是 VSFilter 本身的問題唄。巴洛克哥特 写了:我想着是格式最简单的字幕不用放样本呢= =
字幕: http://pan.baidu.com/s/1jHSss54 密码: vxdv
明白了,感谢holy菊苣的解答~Holy 写了:在 AviSynth 內試了下位置一樣會偏移,或者在 Aegisub 內開個 1024x576 的 Dummy Video 看也是一樣,但是將 Aegisub 的 Subtitle provider 從 xy-vsfilter 改成 libass 看就沒有位置偏移問題……所以這是 VSFilter 本身的問題唄。
Holy 写了:https://github.com/HomeOfVapourSynthEvo ... SFilterMod 看看特效會不會消失……KazamaSion 写了:不支持bord?
代码: 全选
ot = tempfile.NamedTemporaryFile(mode = "w+")
ot_ass = ot.name
ot.seek(0)
ass_contents = xxxxxxxxxxxxxxx
ot.writelines(ass_contents)
mod = IsAssMod(order = order) #别管order是啥
ot.seek(0)
if mod == False:
clip = core.xyvsf.TextSub(clip, file = ot_ass)
else:
clip = core.vsfm.TextSubMod(clip, file = ot_ass)
tempfile.close()
代码: 全选
vapoursynth.Error: TextSubMod: can't open C:\Users\xxxx\AppData\Local\Temp\tmpwcxywxbe
代码: 全选
ot_file = "abc.ass"
ass_contents = xxxxxxxxxxxxxxx
with open(ot_file, 'w+') as f:
f.writelines(ass_contents)
mod = IsAssMod(order = order) #别管order是啥
if mod == False:
clip = core.xyvsf.TextSub(clip, file = ot_ass)
else:
clip = core.vsfm.TextSubMod(clip, file = ot_ass)
tempfile.close()
The doc of NamedTemporaryFile in https://docs.python.org/3.5/library/tempfile.html says:KazamaSion 写了:代码: 全选
vapoursynth.Error: TextSubMod: can't open C:\Users\xxxx\AppData\Local\Temp\tmpwcxywxbe
谢谢,问题已解决。Holy 写了:The doc of NamedTemporaryFile in https://docs.python.org/3.5/library/tempfile.html says:KazamaSion 写了:代码: 全选
vapoursynth.Error: TextSubMod: can't open C:\Users\xxxx\AppData\Local\Temp\tmpwcxywxbe
Whether the name can be used to open the file a second time, while the named temporary file is still open, varies across platforms (it can be so used on Unix; it cannot on Windows NT or later).
So you need to create a named temporary file with delete=False and close the file first before TextSub opens the temporary file.