View Single Post
Old 7th August 2016, 08:27   #7  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Okay, so libavcodec applies some custom color adjustments?

When using Vapoursynth with libsubtitle:
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/LSmashSource/vslsmashsource.dll")
# Loading Source: H:/Output/Test-AC3-5.1.avi
clip = core.lsmas.LWLibavSource(source="H:/Output/Test-AC3-5.1.avi", cache=0)
# loading subtitle TITLE_1_0_lang_en 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()
I get:

using ffplay:
Code:
ffplay c:\Users\Selur\Desktop\muxed.mp4
I get:

using mplayer:
Code:
mplayer C:\Users\Selur\Desktop\Test-AC3-5.1.avi
I get:

using Avisnth and VsFilter:
Code:
LoadCPlugin("G:\Hybrid\AVISYN~1\ffms2.dll")
LoadPlugin("G:\Hybrid\AVISYN~1\VSFilter.dll")
# loading source: C:\Users\Selur\Desktop\Test-AC3-5.1.avi
FFVideoSource("C:\Users\Selur\Desktop\TEST-A~1.AVI",cachefile="H:\Temp\avi_3c69763e8478b88d8cc19d0971dbb14d_4827_1_0.ffindex",fpsnum=25)
# embedding subtitles
VobSub("H:\Output\TITLE_1_0_lang_en")
return last
I get:


using using Vapoursynth with libsubtitle and gray=true:
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/LSmashSource/vslsmashsource.dll")
# Loading Source: H:/Output/Test-AC3-5.1.avi
clip = core.lsmas.LWLibavSource(source="H:/Output/Test-AC3-5.1.avi", cache=0)
# loading subtitle TITLE_1_0_lang_en with LibSubtitle
subs = core.sub.ImageFile(clip=clip, file="H:/Output/TITLE_1_0_lang_en.idx",gray=True)
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()
gives me:


=> Do you by chance know what custom palette ffplay/mplayer/vsfilter are using?

Or is there something wrong with the way I call libsubtitle in Vapoursynth and apply it to the clip? (I followed the example from https://github.com/dubhater/vapoursy...ter/readme.rst)

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote