View Full Version : xy-VSFilter Project (High Performance VSFilter Compatible Subtitle Filters)
kasper93
6th September 2014, 19:15
@cyberbeing: You might want to backport this :) https://github.com/kasper93/mpc-hc/commit/0f0d58c9573400e081feffe4a3325b748496b7ae
cyberbeing
7th September 2014, 00:08
@cyberbeing: You might want to backport this :) https://github.com/kasper93/mpc-hc/commit/0f0d58c9573400e081feffe4a3325b748496b7ae
Hmm, I believe those TV-range RGB to/from YCbCr conversion functions were purposefully left unfinished as placeholders only, since only PC-range RGB should ever be used in the current code. It may be wiser to just comment those lines out. Thanks for pointing that out though, since leaving it that way certainly appears rather suspect. And speaking of that color_conv_table, one thing we never got around to doing was backporting our CompactRGBCorrection from XySubFilter to VSFilter. That may be one thing which MPC-HC may want to look into doing, if you intend to push forward in supporting the 'YCbCr Matrix' tagging solution.
kasper93
7th September 2014, 02:17
Yeah, that's how I found those bugs, because in our work flow we needed those functions. ISR is after renderer so we need to output TV range to match renderer output. I got ISR working, still need to figure out VSFilter. But as I presume in most cases I will need to guess matrix based on resolution. Anyway I'm quite busy now and messing with this only in free time ;)
cyberbeing
7th September 2014, 03:23
Yeah, that's how I found those bugs, because in our work flow we needed those functions. ISR is after renderer so we need to output TV range to match renderer output.
Ah okay, in XySubFilter we always just use ColorConvTable::RGB_PC_TO_TV as the last step (see: xy_bitmap.cpp) when TV range output is requested by the Consumer.
But as I presume in most cases I will need to guess matrix based on resolution.
Well for ASS scripts, the default is TV.601 unless the 'YCbCr Matrix' header specifying which matrix to use is present. You can take a look at how MPV implemented support for this, to get an idea of how these 'YCbCr Matrix' conversions are expected to function with RGB output. With XySubFilter much of this logic is hidden in madVR code (we only do TV.601->TV709 corrections internally by default), so it may not be as immediately apparent looking at our code. Guessing matrix-by-resolution mainly occurs with all subtitle formats except ASS, like SRT etc. Just keep in mind that xy-VSFilter actually uses a AYUV workflow when outputting YCbCr, which could lead to some differences in implementation method compared to MPC-HC VSFilter which always uses a RGB workflow.
ianken
7th September 2014, 06:28
So I feel like a total newb posting this.
In a nutshell: xysubfilter will not render SOME subs in full screen exclusive mode with MADVR. Windowed? No problem? 720p content fullscreen exclusive? Works! 1920 wide content full screen? No subs rendered. IE: 1920x800 == no subs. 1920x1080 == no subs. 1280x720? SUBS up the wazzoooo! The internal MPC-HC render works and that is what I'm using now.
Anway, any hints as to where to look? I'm running the current MPC-HC, latest XYsub and latest MADVR. I have no other 3rd party codecs on the system and rely on the LAV bits bundled with MPC-HC.
-Ian
cyberbeing
7th September 2014, 07:11
@ianken
There is a bug in the current version of madVR (http://bugs.madshi.net/view.php?id=205) which can cause issues like you discribe, but that only occurs with MOD2 height video (at least as far as we are aware). Either way, my first suggestion would be to try the madVR setting workarounds listed there:
Disable "optimize subtitle quality for performance instead of quality"
OR
Enable "reduce banding artifacts"
If the above does not resolve the issue, please test XySubFilter with EVR-CP and see if you can still reproduce the same issue. If it does not occur with the EVR-CP consumer, you should open a new bug with madVR (http://bugs.madshi.net/bug_report_page.php) with details about your GPU and such.
In a nutshell: xysubfilter will not render SOME subs in full screen exclusive mode with MADVR. Windowed? No problem? 720p content fullscreen exclusive? Works! 1920 wide content full screen? No subs rendered.
You should probably clarify this as well if you end up opening a madVR bug. When you say no problem with 'Windowed', does that include Fullscreen Windowed (automatic fullscreen exclusive disabled) both with and without 'present several frames in advance', as well as Fullscreen Windowed Overlay?
Sm3n
7th September 2014, 13:23
Hi,
I'm using "XySubFilter_Relative_Output_Size_Test".
I've accidently switched the "Always load" option to "Never load" (something like that). Is there a way to revert it?
Tried to uninstall & install again but nothing changed. I guess I have to delete something from registry, right?
Thanks
Edit: OK, I found the Restore_Defaults file https://code.google.com/p/xy-vsfilter/issues/detail?id=26
:)
cyberbeing
7th September 2014, 14:33
There are a few other option if you just need change XySubFilter configuration settings.
With MPC-HC this can be easily done by just adding to External Filters, and then double-clicking on the entry.
With GraphStudioNext and similar graph builders, the same thing is possible from the Insert Filters dialog.
The manual way, is to cd to the directory with XySubFilter and then use:
rundll32 XySubFilter.dll,XySubFilterConfiguration
With a slight modification, you could also use the above operation via a shortcut.
Sm3n
7th September 2014, 21:40
With MPC-HC this can be easily done by just adding to External Filters, and then double-clicking on the entry.
Wow the thing I needed.
Thx for the tips!
Zachs
30th September 2014, 03:23
There's a bug in XySubFilter that prevents proper usage of ISubRenderFrame.
A simple fail first / fail fast check of QueryInterface for itself fails.
e.g.
STDMETHODIMP CMpdnRenderer::DeliverFrame(REFERENCE_TIME start, REFERENCE_TIME stop, LPVOID context, ISubRenderFrame *subtitleFrame)
{
// if (subtitleFrame->QueryInterface(IID_ISubRenderFrame, (void**)&subtitleFrame) != S_OK)
// return E_FAIL; // <-- this happens
...
}
This might be a good read (The Old New Thing: The ways people mess up IUnknown::QueryInterface (http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx)).
Cheers.
EDIT: It is indeed an oversight. XySubFilter's source code NonDelegatingQueryInterface does indeed left out ISubRenderFrame but has ISubRenderProvider in there.
madshi
30th September 2014, 09:09
Looks like a little bug in XySubFilter, but it's not dramatic, IMHO. Why double checking the type if the parameter is already hard coded to ISubRenderFrame? Yeah, sure, doesn't hurt to double check, I guess. But if XySubFilter sent in something other than ISubRenderFrame, incorrectly type-converted to ISubRenderFrame, that would be a dramatic bug, IMHO. FWIW, madVR doesn't check the parameter type, IIRC, and it works just fine.
In any case, fixing this in XySubFilter should be a 2 minute job, it should definitely be done.
Zachs
30th September 2014, 09:17
This is critical if it is to be used in. NET. You can't cast it to the right type otherwise.
madshi
30th September 2014, 10:15
Why would you need to cast it *at all*? The DeliverFrame() method should already provide the interface in the right type. So a cast should not be necessary.
Anyway, as I said, it should be easy to fix. Unfortunately the XySubFilter developer is currently not active. If you need this fix urgently, you may have to implement the fix yourself... :(
Zachs
30th September 2014, 10:30
You don't have to cast it. .NET Framework does it internally when the callback occurs. In which case invalid cast exception will be thrown (i.e. cast in .NET on com objects is actually a QI. Marshaling also checks for the correct type before allowing the type to be what the declaration claims it to be).
Edit: not complaining. Just informing. Took me an hour to figure out it's xysubfilter missing a QI export but a minute to fix it.
madshi
30th September 2014, 11:23
Ah, I see, thanks. I've zero experience with .NET.
Zachs
30th September 2014, 11:32
You should try c# someday. It was created by the same guy who created turbo pascal and Delphi. Anders Hejlsberg. He simply took Delphi to the next level.
madshi
30th September 2014, 12:05
I like Delphi a lot. But I dislike the whole .NET concept. I much prefer native compiling/linking over JIT compilation. That's just my personal opinion, of course. And slightly OT here... :)
cyberbeing
30th September 2014, 17:08
Looking through the code, I can only assume this was overlooked because the dev wrapped ISubRenderFrame within XySubRenderIntf.h (https://github.com/Cyberbeing/xy-VSFilter/blob/3.1.0.697/src/filters/transform/vsfilter/XySubRenderIntf.h#L21) as IXySubRenderFrame (ISubRenderFrame is never used directly anywhere in the code) and it seems he did remember to include IXySubRenderFrame in NonDelegatingQueryInterface (https://github.com/Cyberbeing/xy-VSFilter/blob/3.1.0.697/src/subpic/XySubRenderFrameWrapper.cpp#L28).
So is this just a simple fix of adding a single line for ISubRenderFrame to xy_sub_filter.h (https://github.com/Cyberbeing/xy-VSFilter/blob/3.1.0.697/src/filters/transform/vsfilter/xy_sub_filter.h#L18) & xy_sub_filter.cpp (https://github.com/Cyberbeing/xy-VSFilter/blob/3.1.0.697/src/filters/transform/vsfilter/xy_sub_filter.cpp#L156) or is there more to it than that? As madshi mentioned the developer isn't really active right now, but I could certainly commit trivial changes or merge pull requests myself from github and release a new hotfix build if necessary.
Zachs
30th September 2014, 23:26
Yeah its a single line fix. HotFix would be great! Thanks!
SecurityBunny
1st October 2014, 13:29
I would also appreciate a hotfix. :)
Been noticing quite a few subtitle changes in MPC-HC the last couple of weeks. Hopefully XySubFilter is still faster and preferred for quality. Hoping development kicks back up again sometime soon.
cyberbeing
1st October 2014, 19:37
I was only thinking of merging our outstanding pull requests along with the change Zachs requested. I haven't noticed any critically important bugfix in the recent MPC-HC commits, but if I've overlooked something which can be reproduced in XySubFilter, please point out the related MPC-HC commit and I'll look into it.
The XySubFilter developer remains inactive, so development starting back up soon seems very unlikely.
ahaha2013
29th October 2014, 02:15
This shared file.
http://pan.baidu.com/s/1c0b9tfi
neither xyvsfilter nor xysubfilter can dispay correctly.
mpc-hc built-in: http://i2.tietuku.com/7f9932a98be51711.png
can you fix it...
cyberbeing
29th October 2014, 05:41
This shared file.
http://pan.baidu.com/s/1c0b9tfi
neither xyvsfilter nor xysubfilter can dispay correctly.
mpc-hc built-in: http://i2.tietuku.com/7f9932a98be51711.png
can you fix it...
I'm not seeing an issue with XySubFilter, at least on our end. Correct 1920x1080 PGS bitmaps are being sent to the subtitle consumer, and are displayed with EVR-CP & madVR. Though both are resizing the bitmap vertically to 1920x800 to match the video resolution, which messes up the aspect ratio and positioning. You'd need to file a bug report with madVR & MPC-HC about that.
With xy-VSFilter, the video needs to be 1920x1080 for Blu-ray PGS subtitles to display. A workaround for cropped video like that one, is to set Vertical Padding to Extend to 16:9.
kasper93
30th October 2014, 01:15
Fixed. Will be in next nightly.
ahaha2013
30th October 2014, 13:28
thks.
ahaha2013
30th October 2014, 13:29
Fixed. Will be in next nightly.
thks:thanks:
salam2009
11th November 2014, 08:13
Why does xySubFilter get replaced by DirectVobSub when MadVR is disabled?
cyberbeing
11th November 2014, 09:35
xySubFilter requires a subtitle consumer to function.
madVR, EVR-CP (MPC-HC), and VMR9 Renderless (MPC-HC) are currently the only consumers available.
andyvt
11th November 2014, 10:30
xySubFilter requires a subtitle consumer to function.
madVR, EVR-CP (MPC-HC), and VMR9 Renderless (MPC-HC) are currently the only consumers available.
+ EVR-CP in MediaBrowser Theater
salam2009
11th November 2014, 20:43
I know! I'm using EVR-CP and that's the weird thing!
huhn
11th November 2014, 22:43
are you sure the version you use is a EVR CP version that can handle XY subfilter?
salam2009
12th November 2014, 02:44
I have K-Lite Mega Codec Pack v10.8.6 but use MPC-BE (the built-in Renderer is disabled) and they're all x32!
BTW, I just ran the "Install.bat" as administrator, added the two filters as external with 'Preferred' and didn't copy "XySubFilter" anywhere, should I ?!
It works just fine with MadVR enabled!
Volfield
12th November 2014, 06:27
EVR-CP in MPC-HC not MPC-BE
cyberbeing
12th November 2014, 07:03
As mentioned, MPC-BE never merged in support of the EVR-CP subtitle consumer from MPC-HC, so it is currently not supported.
If this is something you desire, you'd need to make a feature request to the MPC-BE devs.
salam2009
12th November 2014, 08:54
hmm, got it. Thanks guys for the note!
Mystery Keeper
12th November 2014, 16:51
I once again request VapourSynth plugin. So far there's only plugin for ASS subtitles, and even it is rather inconvenient (only generates subtitles as clip, but doesn't overlay them on video).
FeliChe
21st November 2014, 23:29
Hi,
sorry for my english writting mistakes.
I can't make XySubFilter 3.1.0.697 run with xbmc.
When placback XBMC recognize the filter.
http://sia1.subirimagenes.net/img/2014/11/21/mini_141121112630338950.png (http://www.subirimagenes.net/i/141121112630338950.png)
Here is the option to be able to open configuration menu xysubfilter wiche I can't
http://sia1.subirimagenes.net/img/2014/11/21/mini_141121112354377175.png (http://www.subirimagenes.net/i/141121112354377175.png)
And here I can't open any of the subtitles files the file, mkv in this case, has which it has 100% sure
http://sia1.subirimagenes.net/img/2014/11/21/mini_141121112343590321.png (http://www.subirimagenes.net/i/141121112343590321.png)
Anyone can help me with this?
Thank you
cyberbeing
22nd November 2014, 00:43
XBMC doesn't support an XySubFilter compatible subtitle consumer.
You'll need to either use xy-VSFilter/VSFilter, or their built-in subtitle renderer.
romulous
24th November 2014, 06:15
Hi,
I have a sample file which shows the subs with a black background (both xy-vsfilter and XYSubFilter). I have experimented with the xy-vsfilter and XYSubFilter options, but am unable to get rid of the background (VLC and XBMC both remove the background however, but both obviously do not use xy-vsfilter or XYSubFilter). Would appreciate some feedback on why that is:
https://dl.dropboxusercontent.com/u/105555957/Subs%20Test.mkv (27.1MB)
Thanks!
cyberbeing
24th November 2014, 15:13
I'm not familiar with he inner workings of the PGS parser/renderer myself. The PGS code is almost entirely sourced from MPC-HC, and since this also occurs with the MPC-HC ISR, you should probably report this issue to them. If this is really an bug, and they figure out a fix, we could probably backport it.
romulous
2nd December 2014, 09:45
If this is really an bug, and they figure out a fix, we could probably backport it.
They have figured it out - the fix is in the latest nightly version of MPC-HC. Would be great if you could work out how to backport it into xy-VSFilter/XYSubFilter.
romulous
cyberbeing
2nd December 2014, 10:42
They have figured it out - the fix is in the latest nightly version of MPC-HC. Would be great if you could work out how to backport it into xy-VSFilter/XYSubFilter.
romulous
Done. Thankfully it was a really simple change, I feared it'd be something much more complex.
romulous
2nd December 2014, 11:13
Great, much appreciated :) If this is the commit, it was only a small change wasn't it?
https://github.com/Cyberbeing/xy-VSFilter/commit/d5310a0c6b8193bfa2cabf0dbb342453d3d191cb
romulous
SecurityBunny
2nd December 2014, 17:14
Done. Thankfully it was a really simple change, I feared it'd be something much more complex.
Mind sharing a compiled build with the fix? :) I compiled the 704 source myself and somehow came out with build 3.1.0.687 (git 472cb11).
https://github.com/Cyberbeing/xy-VSFilter/releases/tag/3.1.0.704
cyberbeing
2nd December 2014, 21:15
Mind sharing a compiled build with the fix? :) I compiled the 704 source myself and somehow came out with build 3.1.0.687 (git 472cb11).
https://github.com/Cyberbeing/xy-VSFilter/releases/tag/3.1.0.704
Strange. Not sure what you did wrong, but to checkout the tag directly from within GIT do the following:
git fetch --tags
git checkout 3.1.0.704
Then just run build_vsfilter.sh -proj xy_sub_filter and you should have a 3.1.0.704 XySubFilter build.
I'll plan on uploading a complied build to GitHub at the beginning of next week.
SecurityBunny
3rd December 2014, 06:11
Strange. Not sure what you did wrong, but to checkout the tag directly from within GIT do the following:
git fetch --tags
git checkout 3.1.0.704
Then just run build_vsfilter.sh -proj xy_sub_filter and you should have a 3.1.0.704 XySubFilter build.
I'll plan on uploading a complied build to GitHub at the beginning of next week.
Thanks. Fetching in git seems to have fixed it. Compiled with the correct version number. :) 3.1.0.704 (git 31d6703)
romulous
6th December 2014, 11:32
Hi,
I have a sample file which - when using xy-VSFilter - produces green letters. When using XYSubFilter, it does not have this problem.
Sample:
https://dl.dropboxusercontent.com/u/105555957/xy-VSFilter%20Green%20Letters.mkv (37.1MB)
Screenshot:
http://i.imgur.com/1yWg61w.jpg
The top window in the screenshot is xy-VSFilter, the bottom window is XYSubFilter. The stream being displayed is the one labelled 'untouched subtitle-track from BDMV-Playlist [ger] (pgs)'. Tried it with MPC-HC as well this time, the subs are displayed ok there, so I think it is restricted to xy-VSFilter alone.
Thanks.
romulous
cyberbeing
6th December 2014, 20:36
The fix for that has been on the vsfilter_rc branch for awhile now.
I'll plan to compile and upload a new xy-VSFilter build at the same time as XySubFilter 3.1.0.704.
romulous
7th December 2014, 01:14
Super, thanks cyberbeing :)
romulous
cyberbeing
7th December 2014, 03:47
xy-VSFilter 3.0.0.306 & XySubFilter 3.1.0.704 builds have been posted to Github.
Download links can be found in the usual places.
Unfortunately I still haven't gotten around to rebuilding the InnoSetup script which I lost a long time ago now, so no installer. I'll consider trying to do something about that next week.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.