View Single Post
Old 2nd August 2016, 19:21   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Nice! Thanks!
quick test with vobsub subtitles seems to work, used:
Code:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SubtitleFilter/LibSubtitle/libsubtitle.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/FFMS2/ffms2.dll")
# Loading Source: F:\TestClips&Co\Test-AC3-5.1.avi
clip = core.ffms2.Source(source="F:/TESTCL~1/TEST-A~1.AVI",cachefile="H:/Temp/avi_54a4199c1a3d3b1476ea1d15dc267332_4827.ffindex",fpsnum=25)
# loading subtitle TITLE_1_0_lang_en from ElephantsDream with LibSubtitle
subs = core.sub.ImageFile(clip=clip, file="H:/Output/TITLE_1_0_lang_en.idx")
alpha = core.std.PropToClip(subs)
subs = core.resize.Bicubic(subs, width=clip.width, height=clip.height, format=clip.format.id, matrix_s="470bg")
gray_format = core.register_format(vs.GRAY, clip.format.sample_type, clip.format.bits_per_sample, 0, 0)
alpha = core.resize.Bicubic(alpha, width=clip.width, height=clip.height, format=gray_format.id)
clip = core.std.MaskedMerge(clip, subs, alpha)
# Output
clip.set_output()
only strange thing is that the subtitle borders shows white in mplayer and yellow when using the vapoursynth script.
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 2nd August 2016 at 20:15.
Selur is offline   Reply With Quote