View Full Version : xy-VSFilter Project (High Performance VSFilter Compatible Subtitle Filters)
cyberbeing
15th June 2014, 13:22
Can you make x64 version?
Here you go (http://www.mediafire.com/?of1065jhppe1pd3).
sdancer75
19th June 2014, 18:25
Hi,
I am trying to implement xy-vsfilter to my custom application using MFC/C++. I initialized successfully the filter using the code below and the directshow graph is playing just fine including the vsfilter.
//VS Filter for subtitling
m_pVSFilter = AddFilter("VS Filter",CLSID_VSFilter);
if (m_pVSFilter == NULL){
ReportError(_T("Failed to initialize the filter (VS Filter)."),hr);
AMLOGINFO(_T("Failed to initialize the filter (VS Filter) %s."),GetErrorCode(hr) );
return FALSE;
}
Now I want to QueryInterface to all public interfaces to open the subtitle file, and to adjust all other options. So, where to look to find all the public interfaces ?
Edit:I just saw the property pages under \xy_vsfilter\src\filters\transform\vsfilter\DirectVobSubPropPage.h but I see only classes not intefaces. Does this mean that I have to modify the source code ? Will this work ?
Regards,
cyberbeing
19th June 2014, 22:14
The public interfaces for xy-VSFilter are IDirectVobSub.h (https://github.com/Cyberbeing/xy-VSFilter/blob/vsfilter_rc/src/filters/transform/vsfilter/IDirectVobSub.h) (original VSFilter interface) & IDirectVobSubXy.h (https://github.com/Cyberbeing/xy-VSFilter/blob/vsfilter_rc/src/filters/transform/vsfilter/IDirectVobSubXy.h) (xy-VSFilter specific options).
XySubFilter only expanded IDirectVobSubXy.h (https://github.com/Cyberbeing/xy-VSFilter/blob/xy_sub_filter_rc3/src/filters/transform/vsfilter/IDirectVobSubXy.h) to include all supported functionality, instead of requiring using both interfaces to access all options. IDirectVobSub remains though.
sdancer75
20th June 2014, 07:41
The public interfaces for xy-VSFilter are IDirectVobSub.h (https://github.com/Cyberbeing/xy-VSFilter/blob/vsfilter_rc/src/filters/transform/vsfilter/IDirectVobSub.h) (original VSFilter interface) & IDirectVobSubXy.h (https://github.com/Cyberbeing/xy-VSFilter/blob/vsfilter_rc/src/filters/transform/vsfilter/IDirectVobSubXy.h) (xy-VSFilter specific options).
XySubFilter only expanded IDirectVobSubXy.h (https://github.com/Cyberbeing/xy-VSFilter/blob/xy_sub_filter_rc3/src/filters/transform/vsfilter/IDirectVobSubXy.h) to include all supported functionality, instead of requiring using both interfaces to access all options. IDirectVobSub remains though.
Thank you for the reply, I think that it should work just fine, but I am having hard time including this file in my project.
#include <./xy_vsfilter/src/filters/transform/vsfilter/IDirectVobSub.h>
When I include the code above I get errors like below ( I am attaching only a small part ):
1>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\wxutil.h(126) : error C3861: 'EXECUTE_ASSERT': identifier not found
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\sts.h(42) : error C2146: syntax error : missing ';' before identifier 'FwRectCoor2'
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\sts.h(42) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\sts.h(42) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\sts.h(93) : error C3083: 'boost': the symbol to the left of a '::' must be a type
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\sts.h(93) : error C3083: 'flyweights': the symbol to the left of a '::' must be a type
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\sts.h(93) : error C2039: 'flyweight' : is not a member of '`global namespace''
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\sts.h(93) : error C2143: syntax error : missing ';' before '<'
Under wxutil.h "EXECUTE_ASSERT" is defined just fine and the other errors are not real error I am sure of that. I am thinking that is something wrong with the included relative paths as well as the order of that paths. The IDirectVobSub.h have also relative paths inside and really I dont want to get in into a game trying to fix all project paths. Can you suggest something better than that ?
Any suggestions ?
cyberbeing
20th June 2014, 09:20
The sts.h errors are probably since you forgot to include flyweight_base_types.h & possibly the boost .\thirdparty\ directory in your project file's includes.
The wxutil.h error is maybe SDK related? Try using one of the built-in Platform Toolset SDKs (v100, v110_xp, v120_xp), and then including wxutil.h directly from .\src\filters\BaseClasses\
If you are not already, should should probably use the most up-to-date xy-VSFilter branch vsfilter_rc (https://github.com/Cyberbeing/xy-VSFilter/tree/vsfilter_rc) as well.
If that doesn't fix it, I have no other ideas. I'm more of the end-user support guy rather than a developer, and rarely touch the code or troubleshoot errors like this.
sdancer75
20th June 2014, 11:18
The sts.h errors are probably since you forgot to include flyweight_base_types.h & possibly the boost .\thirdparty\ directory in your project file's includes.
The wxutil.h error is maybe SDK related? Try using one of the built-in Platform Toolset SDKs (v100, v110_xp, v120_xp), and then including wxutil.h directly from .\src\filters\BaseClasses\
If you are not already, should should probably use the most up-to-date xy-VSFilter branch vsfilter_rc (https://github.com/Cyberbeing/xy-VSFilter/tree/vsfilter_rc) as well.
If that doesn't fix it, I have no other ideas. I'm more of the end-user support guy rather than a developer, and rarely touch the code or troubleshoot errors like this.
Hi,
Thanks for your help. The things are going better now but, I am still missing some headers here..... and I think, that this concerns defined data types ie int32_t. Take a look below
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(115) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
which refers to line 115 : const int32_t* tmp = reinterpret_cast<const int32_t*>(&d);
The int32_t data type is defined at
c:\gnosis_v2.00\DShowFilters\Filters\Subtitles\xy_vsfilter\src\thirdparty\boost_1_47_0\boost\cstdint.hpp
and the boost successfully included to the search path. What seems to be wrong here ?
Do you have any idea why do I have such error ?
Regards,
EDIT : It seems that the file c:\gnosis_v2.00\DShowFilters\Filters\Subtitles\xy_vsfilter\src\thirdparty\boost_1_47_0\boost\cstdint.hpp defines the int32_t. For some reason the definition structor is failed in check line below
# if UINT_MAX == 0xffffffff
So the int32_t is never defined. If I define this data type manually, seems to overcome the problem and it compiles fine, but I am still curious why the heck this part is failed. It supposed this code is a tested and verified successfully !!!! Anyway I suspect the reason..... Because I am running my project (its still a 32-bit app) under an 64Bit Windows7 the int here is 64 bits length. In this case the boost library sould take care this situation. But now I am thinking that boost 1.47 is pretty old and maybe some bugs are living in there! What do you think ?
cyberbeing
20th June 2014, 13:00
Well as mentioned above, you should probably be using the vsfilter_rc branch which had a lot of project file updates along with support for VS2013. The latest Boost 1.55.0 is used in that branch. If it still fails, I can only suggest double checking your includes against our project files.
Bad come to worse, if you only require the functionality from the IDirectVobSub.h legacy interface, you don't necessarily need to include it from the xy-VSFilter project itself for it to function with xy-VSFilter. It's the same interface found in Guliverkli2 (VSFilter 2.39) (https://sourceforge.net/p/guliverkli2/code/HEAD/tree/src/filters/transform/vsfilter/IDirectVobSub.h) as well as shared by MPC-HC VSFilter (https://github.com/mpc-hc/mpc-hc/blob/master/src/filters/transform/VSFilter/IDirectVobSub.h), and neither of those projects have a Boost requirement in sts.h
sdancer75
24th June 2014, 17:04
Well as mentioned above, you should probably be using the vsfilter_rc branch which had a lot of project file updates along with support for VS2013. The latest Boost 1.55.0 is used in that branch. If it still fails, I can only suggest double checking your includes against our project files.
Bad come to worse, if you only require the functionality from the IDirectVobSub.h legacy interface, you don't necessarily need to include it from the xy-VSFilter project itself for it to function with xy-VSFilter. It's the same interface found in Guliverkli2 (VSFilter 2.39) (https://sourceforge.net/p/guliverkli2/code/HEAD/tree/src/filters/transform/vsfilter/IDirectVobSub.h) as well as shared by MPC-HC VSFilter (https://github.com/mpc-hc/mpc-hc/blob/master/src/filters/transform/VSFilter/IDirectVobSub.h), and neither of those projects have a Boost requirement in sts.h
Hi,
I am publishing my solution to help anyone that meets the same kind of problems. I am using the original boost library.....
#include "./DShowFilters/Filters/Subtitles/xy_vsfilter/src/thirdparty/boost_1_47_0/boost/cstdint.hpp"
#include "c:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses\wxdebug.h"
using namespace boost;
#include "./DShowFilters/Filters/Subtitles/xy_vsfilter/src/subtitles/flyweight_base_types.h"
#include "./DShowFilters/Filters/Subtitles/xy_vsfilter/src/filters/transform/vsfilter/IDirectVobSub.h"
To use the IVobInterface
//**************** Declarations ******************************************
// {93A22E7A-5091-45EF-BA61-6DA26156A5D0}
DEFINE_GUID(CLSID_VSFilter,
0x93A22E7A, 0x5091, 0x45EF, 0xBA, 0x61, 0x6D, 0xA2, 0x61, 0x56, 0xA5, 0xD0);
IDirectVobSub *m_pDirectVobSub;
//**************** 3-Step Implementation code ******************************
//----------------------------------------------------------------------------------------
//(1). Initialization
//----------------------------------------------------------------------------------------
//VS Filter for subtitling, add filter to the graph
m_pVSFilter = AddFilter("VS Filter",CLSID_VSFilter);
if (m_pVSFilter == NULL){
ReportError(_T("Failed to initialize the filter (VS Filter)."),hr);
AMLOGINFO(_T("Failed to initialize the filter (VS Filter) %s."),GetErrorCode(hr) );
return FALSE;
}
m_pVSFilter->QueryInterface(IID_IDirectVobSub, (void**) &m_pDirectVobSub);
//----------------------------------------------------------------------------------------
//(2). Process
//----------------------------------------------------------------------------------------
//..... do the job (add your custom code here using m_pDirectVobSub ptr )..........
//----------------------------------------------------------------------------------------
//(3). Clean up
//----------------------------------------------------------------------------------------
//release interface, else you get mem errors.
if (m_pVSFilter) {
m_pVSFilter->Release();
m_pVSFilter = NULL;
}
sdancer75
28th June 2014, 19:44
Hi,
I finally did it and now it works. I spend almost two days trying to find out, why my app crashed everytime I tried to load a *.srt file.
Everytime I tried to load a *.srt ascii encoded file, the code below crashed (actually the app, just died silently in debug mode)
if (m_pDirectVobSub != NULL){
hr = m_pDirectVobSub->put_FileName(m_wcSubTitleFileName);
}
On the other side, when I tried to load the same file but encoded in a unicode (UTF-8 without BOM) scheme, it worked just fine.
Do you know if I should adjust something before I try to load the file to make it work also in ascii encoding ?
Under the graphstudionext, the filter works fine in either way (ascii and unicode).
Regards,
cyberbeing
30th June 2014, 06:25
Below is an excerpt of what MPC-BE uses (https://github.com/jeeb/mpc-be/blob/master/src/apps/mplayerc/MainFrm.cpp#L5748), and it seems to work fine loading both UTF-8 and ASCII encoded subtitles into xy-VSFilter.
IBaseFilter* CMainFrame::GetVSFilter()
{
IBaseFilter* _pDVS = NULL;
BeginEnumFilters(m_pGB, pEF, pBF) {
if (CComQIPtr<IDirectVobSub> pDVS = pBF) {
_pDVS = pBF;
break;
}
}
EndEnumFilters;
return _pDVS;
}
if (bIsValidSubExtAll && m_iMediaLoadState == MLS_LOADED && (m_pCAP || b_UseVSFilter)) {
POSITION pos = sl.GetHeadPosition();
while (pos) {
CString fname = sl.GetNext(pos);
BOOL b_SubLoaded = FALSE;
if (b_UseVSFilter) {
CComQIPtr<IDirectVobSub> pDVS = GetVSFilter();
if (pDVS && SUCCEEDED(pDVS->put_FileName((LPWSTR)(LPCWSTR)fname))) {
pDVS->put_SelectedLanguage(0);
pDVS->put_HideSubtitles(true);
pDVS->put_HideSubtitles(false);
b_SubLoaded = TRUE;
}
}
}
return;
}
If your ASCII subtitle file can be loaded manually without issue via Main -> Open... in VSFilter settings, there should be no functional difference when using put_FileName assuming the string is being passed correctly.
ahaha2013
1st July 2014, 09:16
It can see nothing with potplayer+evr...
sdancer75
1st July 2014, 12:49
Below is an excerpt of what MPC-BE uses (https://github.com/jeeb/mpc-be/blob/master/src/apps/mplayerc/MainFrm.cpp#L5748), and it seems to work fine loading both UTF-8 and ASCII encoded subtitles into xy-VSFilter.
IBaseFilter* CMainFrame::GetVSFilter()
{
IBaseFilter* _pDVS = NULL;
BeginEnumFilters(m_pGB, pEF, pBF) {
if (CComQIPtr<IDirectVobSub> pDVS = pBF) {
_pDVS = pBF;
break;
}
}
EndEnumFilters;
return _pDVS;
}
if (bIsValidSubExtAll && m_iMediaLoadState == MLS_LOADED && (m_pCAP || b_UseVSFilter)) {
POSITION pos = sl.GetHeadPosition();
while (pos) {
CString fname = sl.GetNext(pos);
BOOL b_SubLoaded = FALSE;
if (b_UseVSFilter) {
CComQIPtr<IDirectVobSub> pDVS = GetVSFilter();
if (pDVS && SUCCEEDED(pDVS->put_FileName((LPWSTR)(LPCWSTR)fname))) {
pDVS->put_SelectedLanguage(0);
pDVS->put_HideSubtitles(true);
pDVS->put_HideSubtitles(false);
b_SubLoaded = TRUE;
}
}
}
return;
}
If your ASCII subtitle file can be loaded manually without issue via Main -> Open... in VSFilter settings, there should be no functional difference when using put_FileName assuming the string is being passed correctly.
Hi,
Thank you for your reply. The file can be loaded without issues via Main->Open in VSFilter, that's why it drives me crazy this problem.
The code used MPC-BE does not seems to work either, it even does not compile since it can not convert CString to LPCWSTR (projects does not run using unicode char set) at line
(LPWSTR)(LPCWSTR)fname
Anyway, I will search deep in the code to find out why....
cyberbeing
1st July 2014, 17:38
It can see nothing with potplayer+evr...
Potplayer EVR does not support XySubFilter, so you'd need to use madVR.
If you instead wanted to use xy-VSFilter (VSFilter.dll) with EVR in Potplayer, I believe you need to add it to Filter Control -> Global Filter Priority as Prefer, disable the PotPlayer built-in subtitle renderer, and disable the PotPlayer video post-processing filter.
sdancer75
2nd July 2014, 07:53
Hi,
Thank you for your reply. The file can be loaded without issues via Main->Open in VSFilter, that's why it drives me crazy this problem.
The code used MPC-BE does not seems to work either, it even does not compile since it can not convert CString to LPCWSTR (projects does not run using unicode char set) at line
(LPWSTR)(LPCWSTR)fname
Anyway, I will search deep in the code to find out why....
I finally decided that this is a bug. I created a new win32 project with clean code and the behavior its the same.
I tested an older version "xy-VSFilter 3.0.0.63 -=Stable Build=-" and it works just fine. I dont have time to debug the vsfilter to fix it, so I will stay temporarily with the older version.
I am attaching the project as well as the filters used (LavFilters and VSFilter v 3.0.0.211) for debugging purposes.
http://speedy.sh/PPJFD/DShow-Filters.zip
------------------------------------------------------------------------------------
//*************************************************************************************************
// SubtitleTest.cpp : Defines the entry point for the console application.
//
//Copyright (c) George Papaioannou, Greece 2014
//
//
// DirectShow Example using VSFiler v 3.0.0.211
//
// Problem : The application crashed silently when ascii encoded *.srt file is used for subtitles
// Application works just fine when a unicode encoded *.srt file is used instead.
//*************************************************************************************************
#include "stdafx.h"
#include <afx.h>
#include <dshow.h>
#include <D3d9.h>
#include <initguid.h>
#include <atlbase.h>
#include <string>
#include <assert.h>
//********************* VobSub ******************************************************************
#include "../DShowFilters/Filters/Subtitles/xy_vsfilter/src/thirdparty/boost_1_47_0/boost/cstdint.hpp"
#include "c:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses\wxdebug.h"
using namespace boost;
#include "../DShowFilters/Filters/Subtitles/xy_vsfilter/src/subtitles/flyweight_base_types.h"
#include "../DShowFilters/Filters/Subtitles/xy_vsfilter/src/filters/transform/vsfilter/IDirectVobSub.h"
static const IID IID_IDirectVobSub =
{ 0xEBE1FB08, 0x3957, 0x47CA, { 0xAF, 0x13, 0x58, 0x27, 0xE5, 0x44, 0x2E, 0x56 } };
DEFINE_GUID(CLSID_VSFilter,
0x93A22E7A, 0x5091, 0x45EF, 0xBA, 0x61, 0x6D, 0xA2, 0x61, 0x56, 0xA5, 0xD0);
//*************************************************************************************************
//{EE30215D-164F-4A92-A4EB-9D4C13390F9F}
DEFINE_GUID(CLSID_LAVSplitter,
0xEE30215D, 0x164F, 0x4A92, 0xA4, 0xEB, 0x9D, 0x4C, 0x13, 0x39, 0x0F, 0x9F);
#pragma comment( lib, "strmiids.lib" )
#pragma comment( lib, "Strmbasd.lib" )
#pragma comment( lib, "Quartz.lib" )
#pragma comment( lib, "d3d9.lib" )
#pragma comment( lib, "d3dx9.lib" )
//************** Global Variables **********************
IGraphBuilder *pGraph = NULL; // Graph builder interface
IMediaControl *pControl = NULL; // Media control interface
IMediaEvent *pEvent = NULL; // Media event interface
IBaseFilter *pVsFilter = NULL;
IDirectVobSub *pDirectVobSub = NULL;
IBaseFilter *pLavSplitter = NULL;
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
long evCode;
// Initialize the COM library.
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr))
{
goto EndApp;
}
// Create the Filter Graph Manager and query for interfaces.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void **)&pGraph);
if (FAILED(hr)) // FAILED is a macro that tests the return value
{
goto EndApp;
}
// Use IGraphBuilder::QueryInterface (inherited from IUnknown)
// to get the IMediaControl interface.
hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
if (FAILED(hr))
{
goto EndApp;
}
// And get the Media Event interface, too.
hr = pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
if (FAILED(hr))
{
goto EndApp;
}
hr = CoCreateInstance(CLSID_LAVSplitter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**) &pLavSplitter);
if (SUCCEEDED(hr))
{
hr = pGraph->AddFilter(pLavSplitter, L"LAV Splitter Source");
} else {
goto EndApp;
}
hr = CoCreateInstance(CLSID_VSFilter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**) &pVsFilter);
if (SUCCEEDED(hr)) {
hr = pGraph->AddFilter(pVsFilter, L"VSFilter");
hr = pVsFilter->QueryInterface(IID_IDirectVobSub, (void **)&pDirectVobSub);
} else {
goto EndApp;
}
hr = pGraph->RenderFile(L"C:\\GOODVIDEO.AVI", NULL);
hr = pDirectVobSub->put_FileName(L"C:\\subtitle_ascii.srt"); // <---- App crashes silently when using ascii encoded srt file !!
if (SUCCEEDED(hr)) {
// Run the graph.
hr = pControl->Run();
if (SUCCEEDED(hr))
{
// Wait for completion.
pEvent->WaitForCompletion(INFINITE, &evCode);
if (evCode != S_OK) {
printf("Movie is stopped by the user !");
}
// Note: Do not use INFINITE in a real application
// because it can block indefinitely.
}
// And stop the filter graph.
hr = pControl->Stop();
}
EndApp:
if (pLavSplitter)
pLavSplitter->Release();
if (pDirectVobSub)
pDirectVobSub->Release();
if (pVsFilter)
pVsFilter->Release();
if (pControl)
pControl->Release();
if (pEvent)
pEvent->Release();
if (pGraph)
pGraph->Release();
CoUninitialize();
return 0;
}
sdancer75
2nd July 2014, 11:36
Ok another issue now...... It supposed it was fixed on Issue 92
https://code.google.com/p/xy-vsfilter/issues/detail?id=92&can=1
put_HideTrayIcon(TRUE) does not seem to hide the tray icon. It just marks the check box, but if you dont click "apply" or "ok" in page properties, it does nothing.
I can not use "apply" under a c++ code, so how can I hide the tray icon immediately when I call put_HideTrayIcon(TRUE) ?
Regards,
cyberbeing
2nd July 2014, 22:02
sdancer75, could you also test these issues against a build from the vsfilter_rc (https://github.com/Cyberbeing/xy-VSFilter/tree/vsfilter_rc) xy-VSFilter branch, as well as MPC-HC VSFilter (http://nightly.mpc-hc.org) to see if it's also reproducible?
cyberbeing
3rd July 2014, 07:29
...well I can't actually seem to reproduce this with your SubtitleTest.zip (https://code.google.com/p/xy-vsfilter/issues/detail?id=190#c1) sample project.
I did update the includes and project for VS2010 though.
Removed the "#pragma comment (lib" lines.
Added Linker -> Input -> Additional Dependencies, strmbaseR.lib; strmiids.lib; quartz.lib; d3d9.lib; d3dx9.lib
Added library directories for Microsoft DirectX SDK (June 2010) and xy-VSFilter Baseclasses (strmbaseR.lib).
Changed explicit wxdebug.h path to #include <wxdebug.h>
Added include directory, \xy_vsfilter\src\filters\BaseClasses
Changed the test files to "C:\\test\\test.mkv" & "C:\\test\\subtitle.srt"
Removed "using namespace boost;" since it was causing a compiler error with sts.h from the master branch (3.0.0.211 + Boost 1.47).
Here is the resulting VS2010 binary (both master & vsfilter_rc branches) of your test project + test files which seems to function without issue:
https://www.mediafire.com/?0jkh6hyaz6eo20o
Since you opened Issue #190 on our bug tracker, let's continue discussion there.
sdancer75
3rd July 2014, 08:54
sdancer75, could you also test these issues against a build from the vsfilter_rc (https://github.com/Cyberbeing/xy-VSFilter/tree/vsfilter_rc) xy-VSFilter branch, as well as MPC-HC VSFilter (http://nightly.mpc-hc.org) to see if it's also reproducible?
I will give it a try !
sdancer75
3rd July 2014, 09:04
...well I can't actually seem to reproduce this with your SubtitleTest.zip (https://code.google.com/p/xy-vsfilter/issues/detail?id=190#c1) sample project.
I did update the includes and project for VS2010 though.
Removed the "#pragma comment (lib" lines.
Added Linker -> Input -> Additional Dependencies, strmbaseR.lib; strmiids.lib; quartz.lib; d3d9.lib; d3dx9.lib
Added library directories for Microsoft DirectX SDK (June 2010) and xy-VSFilter Baseclasses (strmbaseR.lib).
Changed explicit wxdebug.h path to #include <wxdebug.h>
Added include directory, \xy_vsfilter\src\filters\BaseClasses
Changed the test files to "C:\\test\\test.mkv" & "C:\\test\\subtitle.srt"
Removed "using namespace boost;" since it was causing a compiler error with sts.h from the master branch (3.0.0.211 + Boost 1.47).
Here is the resulting VS2010 binary (both master & vsfilter_rc branches) of your test project + test files which seems to function without issue:
https://www.mediafire.com/?0jkh6hyaz6eo20o
Since you opened Issue #190 on our bug tracker, let's continue discussion there.
Well..... I registered again the supposed buggy VSFilter 3.0.0.211 and it worked like charm ......
I will try to recompile the code following your steps and I will let you know. Did you also checked the issue with the system tray icon ?
sdancer75
3rd July 2014, 09:56
Removed "using namespace boost;" since it was causing a compiler error with sts.h from the master branch (3.0.0.211 + Boost 1.47).
If you removed "using namespace boost;" how did you resolved the errors like :
>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(116) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(116) : error C2143: syntax error : missing ';' before '*'
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(116) : error C2065: 'tmp' : undeclared identifier
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(116) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(116) : error C2061: syntax error : identifier 'int32_t'
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(118) : error C2065: 'tmp' : undeclared identifier
1>c:\gnosis_v2.00\dshowfilters\filters\subtitles\xy_vsfilter\src\subtitles\flyweight_base_types.h(120) : error C2065: 'tmp' : undeclared identifier
cyberbeing
3rd July 2014, 09:56
put_HideTrayIcon(TRUE)
The api function called put_HideTrayIcon only exists in old depreciated versions of the IDirectVobSubXy.h api, so I wouldn't recommend using it. At some point before 3.0.0.211, IDirectVobSubXy.h and its related settings were completely refactored.
I did a quick test with pDirectVobSubXy->XySetBool(BOOL_HIDE_TRAY_ICON, true) using IDirectVobSubXy.h from the master branch, and it seems to function as expected. Here is another binary of your test project which uses IDirectVobSubXy.h to hide the tray icon, in addition to loading the subtitle file with IDirectVobSub.h as in the above linked build: https://www.mediafire.com/?hxc21433b3mayl7
#include "..\xy_vsfilter\src\filters\transform\vsfilter\IDirectVobSubXy.h"
static const IID IID_IDirectVobSubXy =
{ 0x85E5D6F9, 0xBEFB, 0x4E01, { 0xB0, 0x47, 0x75, 0x83, 0x59, 0xCD, 0xF9, 0xAB } };
IDirectVobSubXy *pDirectVobSubXy = NULL;
hr = pVsFilter->QueryInterface(IID_IDirectVobSubXy, (void **)&pDirectVobSubXy);
using namespace DirectVobSubXyOptions;
hr = pDirectVobSubXy->XySetBool(BOOL_HIDE_TRAY_ICON, true);
hr = pGraph->RenderFile(L"C:\\test\\test.mkv", NULL);
Note: You'll need to move the includes from BaseVideoFilter.cpp to BaseVideoFilter.h for it to compile without error.
If you removed "using namespace boost;" how did you resolved the errors like
Maybe boost behaves differently with older Visual Studio? It seems like you were using VC9? One thing I did notice, was that using the vsfilter_rc branch (Boost 1.55.0), it would compile just fine with or without "using namespace boost;". I wouldn't worry much about it, just use whatever works.
sdancer75
3rd July 2014, 10:33
The api function called put_HideTrayIcon only exists in old depreciated versions of the IDirectVobSubXy.h api, so I wouldn't recommend using it. At some point before 3.0.0.211, IDirectVobSubXy.h and its related settings were completely refactored.
I did a quick test with pDirectVobSubXy->XySetBool(BOOL_HIDE_TRAY_ICON, true) using IDirectVobSubXy.h from the master branch, and it seems to function as expected. Here is another binary of your test project which uses IDirectVobSubXy.h to hide the tray icon, in addition to loading the subtitle file with IDirectVobSub.h as in the above linked build: https://www.mediafire.com/?hxc21433b3mayl7
#include "..\xy_vsfilter\src\filters\transform\vsfilter\IDirectVobSubXy.h"
static const IID IID_IDirectVobSubXy =
{ 0x85E5D6F9, 0xBEFB, 0x4E01, { 0xB0, 0x47, 0x75, 0x83, 0x59, 0xCD, 0xF9, 0xAB } };
IDirectVobSubXy *pDirectVobSubXy = NULL;
hr = pVsFilter->QueryInterface(IID_IDirectVobSubXy, (void **)&pDirectVobSubXy);
using namespace DirectVobSubXyOptions;
hr = pDirectVobSubXy->XySetBool(BOOL_HIDE_TRAY_ICON, true);
hr = pGraph->RenderFile(L"C:\\test\\test.mkv", NULL);
Note: You'll need to move the includes from BaseVideoFilter.cpp to BaseVideoFilter.h for it to compile without error.
Maybe boost behaves differently with older Visual Studio? It seems like you were using VC9? One thing I did notice, was that using the vsfilter_rc branch (Boost 1.55.0), it would compile just fine with or without "using namespace boost;". I wouldn't worry much about it, just use whatever works.
Ok.... Problem found !!!!!!! Its almost ridiculous that I spend four days for that stupid thing.
if *.srt subtitles containts non-latin characters (and of course non standard ascii chars, ie greeks in my case) the app crashes.
Replace your subtitles.srt with the one I am attaching in this post, and enjoy the result. The filter in this case should return an E_FAIL, FALSE or something to manage the error...
Mysteriously, that is not happening when using the property pages.
cyberbeing
3rd July 2014, 10:59
Hmm, I wonder if that's really it. I did try it with a Cyrillic (Windows-1251) encoded subtitle before I initially uploaded the binary, and it seemed fine. Though I am running Windows with a US-English locale, which obviously will render non-English ASCII encoded subtitles as gibberish. Maybe your issue is only triggered when using a particular Windows locale? I guess I'll see once your subtitle.zip attachment is approved.
Edit: While awaiting your attachment approval, I tested a Greek (Windows-1252) encoded subtitle with matching Greek non-unicode Windows locale, and everything seemed fine (subtitles displayed in Greek, no crash). There must be something special about the subtitle file your are testing, like an invalid unicode character mixed in somewhere. Have you been testing with a font which natively supports the Greek codepage?
sdancer75
3rd July 2014, 12:09
Hmm, I wonder if that's really it. I did try it with a Cyrillic (Windows-1251) encoded subtitle before I initially uploaded the binary, and it seemed fine. Though I am running Windows with a US-English locale, which obviously will render non-English ASCII encoded subtitles as gibberish. Maybe it's somehow locale related? I guess I'll see once your subtitle.zip attachment is approved.
Edit: While awaiting your attachment approval, I tested a Greek (Windows-1252) encoded subtitle with matching Greek non-unicode Windows locale, and everything seemed fine... There must be something special about the subtitle file your are testing, like an invalid unicode character mixed in somewhere. Have you been testing with a font which natively supports the Greek codepage?
Hi,
Now I am working with the latest version 3.0.0.211, with all issues solved.
I can confirm that changing the country, local and regional settings to US egnlish ( now I see greek chars rendered as gibberish as you correctly described) , the problem still exists. So, I think its a windows related problem. I own an original OEM Windows7 64Bit Greek Home Premium version updated to SP1.
Thank you for your time.
Best Regards,
ahaha2013
8th July 2014, 06:02
It is a time to release a new version?:thanks:
ahaha2013
9th July 2014, 17:26
The srt pre-languages can't not work. Why? How?
I have set the pre-lang in the lav spiliter.
http://i1.tietuku.com/fe65ced99f301158.png
I use mpc(1.7.6.30) + lavfiters(0.62) + vsfilter.dll(3.0.0.300 git 6c0c23a)
--
Edit
--
There were two file:
How To Train Your Dragon.eng.srt
and
How To Train Your Dragon.srt
What I wanted was it can auto load *.eng.srt.
Superb
10th July 2014, 00:24
If I'm not mistaken, LAV Splitter isn't the one loading the external srt files, so your configuration there is quite useless.
Maybe look at the "Player" page under MPC-HC's options. There you can try and set the subtitle auto loading to "eng abc" (without the quotes; with a space, not a comma).
I'm writing "maybe" because I'm not sure if it affects the external VSFilter you're using.
Mystery Keeper
12th July 2014, 19:13
Could you please make a subtitles overlay filter for VapourSynth (http://forum.doom9.org/showthread.php?t=165771)?
sneaker_ger
12th July 2014, 19:19
Just to make sure: you know about AssVapour (http://www.vapoursynth.com/doc/plugins/assvapour.html)?
Mystery Keeper
12th July 2014, 22:15
Of course I do. But ASS is not the only subtitles format around. I recently needed to overlay VobSub.
sdancer75
15th July 2014, 14:28
...It me again :-)
Another issue with xy-vsfilter-3.0.0.211....
Trying to load a *.srt file that its extenstion is written with uppercase letters (ie Subtitles.SRT) using the method put_FileName it fails, returing to the caller with the E_FAIL code.
I can confirm that the same it is happening with the page properties using any graph editor like the GraphStudioNext that I am using.
Regards,
[ReX]
15th July 2014, 20:41
...It me again :-)
Another issue with xy-vsfilter-3.0.0.211....
Trying to load a *.srt file that its extenstion is written with uppercase letters (ie Subtitles.SRT) using the method put_FileName it fails, returing to the caller with the E_FAIL code.
I can confirm that the same it is happening with the page properties using any graph editor like the GraphStudioNext that I am using.
Regards,
It's a simple fix (https://github.com/Cyberbeing/xy-VSFilter/commit/bf88321566b4306d0a38275cb8cc2d9ebe799811).
sdancer75
16th July 2014, 08:11
;1686949']It's a simple fix (https://github.com/Cyberbeing/xy-VSFilter/commit/bf88321566b4306d0a38275cb8cc2d9ebe799811).
Thank you,
Since I didn't want to re-compile the filter, I just changed my code, to lowercase the filenames.
I just mentioned the issue to be fixed in the next release (beside the fact that I lost almost 4 hours of debugging why the heck the function returned E_FAIL).
Best Regards,
wanezhiling
19th July 2014, 11:33
https://www.sendspace.com/file/tb7erh
XySubFilter_3.1.0.697_x86_BETA2, default setting
madVR 0.87.10, default setting
Can not show the sub with original 100% window size.
cyberbeing
19th July 2014, 11:57
You are likely experiencing madVR issue #205 (http://bugs.madshi.net/view.php?id=205) which only seems to occur with mod2 video when using madVR >= 0.87.0 with certain settings. Please check the madVR setting workarounds posted in that issue (disabling optimize subtitle quality for performance, or enabling debanding), and also EVR-CP. This isn't a bug with XySubFilter itself.
wanezhiling
19th July 2014, 14:01
Please check the madVR setting workarounds posted in that issue (disabling optimize subtitle quality for performance, or enabling debanding), and also EVR-CP.
That's it!
Thanks!
GCRaistlin
20th July 2014, 15:12
How do I make XySubFilter to load automatically while playing a DVD? MPC-HC 1.7.6.102, XySubFilter 3.1.0.697.
cyberbeing
20th July 2014, 17:36
You could set it to 'Always Load' in settings, but it cannot be used to render subtitles directly from DVDs being played via DVD Navigator. You'll need to use LAV Video or some other DVD Video decoder if you require standard DVD playback subtitle rendering.
Though if you open the VOB files on the DVD directly, xy-VSFilter/XySubFilter should be able to display the subtitles using MPC-BE's internal MPEG-2 splitter. You must use MPC-BE, since both MPC-HC and LAV Splitter are currently broken for this purpose. LAVSplitter outputs an incorrect VOBSUB palette to VSFilter, while MPC-HC always seems to hijack internal VOBSUB subtitle pin with NullTextRenderer.
GCRaistlin
20th July 2014, 18:24
You could set it to 'Always Load' in settings, but it cannot be used to render subtitles directly from DVDs being played via DVD Navigator.
I need XySubFilter to render external subtitles while playing a DVD. It is loaded if "Always Load" is selected but works in a buggy way: subtitles are displayed at the wrong time (all is OK if the same subtitles are loaded via File | Load subtitle...) and don't recognize time jumps (if I move the time elevator to the begin of the movie subtitles are just displayed further, not from the beginning).
You'll need to use LAV Video or some other DVD Video decoder if you require standard DVD playback subtitle rendering.
Isn't LAV Video being used to play DVDs? I believe it is. I've got its icon in the system tray while playing a DVD.
both MPC-HC and LAV Splitter are currently broken for this purpose.
Are their authors aware of these issues?
cyberbeing
20th July 2014, 22:28
I need XySubFilter to render external subtitles while playing a DVD. It is loaded if "Always Load" is selected but works in a buggy way: subtitles are displayed at the wrong time (all is OK if the same subtitles are loaded via File | Load subtitle...) and don't recognize time jumps (if I move the time elevator to the begin of the movie subtitles are just displayed further, not from the beginning).
How are you loading the subtitles into XySubFilter? 'Properties | Open...' ?
When you say 'File | Load subtitle...' are you referring to using the MPC-HC ISR with XySubFilter disabled, or MPC-BE with XySubFilter active?
Taken at face value, I'm not sure what can be done about that when the DVD has adverts and menus before the main title. You'd probably just need to shift the timings of the external subtitle to compensate for the discrepancy. Though if it doesn't work you'd expect when loading external subtitles with actual DVDs, I'd say just don't use XySubFilter for that particular use-case.
Isn't LAV Video being used to play DVDs? I believe it is. I've got its icon in the system tray while playing a DVD.
LAV Video has a built-in subtitle renderer for DVD subtitles, but since you wanted to load external subtitles, that doesn't matter.
Are their authors aware of these issues?
Probably not, as I only just now discovered both issues. Though if you were not attempting to load internal VOBSUB from MPEG2 VOB files, this wouldn't affect you.
GCRaistlin
21st July 2014, 13:56
How are you loading the subtitles into XySubFilter? 'Properties | Open...' ?
Yes.
When you say 'File | Load subtitle...' are you referring to using the MPC-HC ISR with XySubFilter disabled?
Yes, it's about MPC-HC ISR. Actually, it is disabled in Options ("Use the built-in subtitle renderer" is unchecked) but works this way (not only with DVDs but with media files, too).
Taken at face value, I'm not sure what can be done about that when the DVD has adverts and menus before the main title.
The IFO with the movie I experience this issue on contains two PGCs. Maybe it's the cause.
cyberbeing
21st July 2014, 15:25
Yes, it's about MPC-HC ISR. Actually, it is disabled in Options ("Use the built-in subtitle renderer" is unchecked) but works this way (not only with DVDs but with media files, too).
That shouldn't be the case, unless you are using an old version of MPC-HC. That behavior of enabling the ISR on-the-fly when disabled in settings, with VSFilter already loaded, was removed in MPC-HC 1.7.5+ IIRC. Though I guess you are saying you had XySubFilter disabled in those instances, rather than idle.
nevcairiel
21st July 2014, 16:27
Probably not, as I only just now discovered both issues. Though if you were not attempting to load internal VOBSUB from MPEG2 VOB files, this wouldn't affect you.
.vob files don't have any palette at all, so LAV provides a default palette, since many renderers otherwise just used to output everything in black. How can this be incorrect?
You can accept the DVD type instead of the vobsub type if you want, which doesn't include any palette at all.
GCRaistlin
21st July 2014, 16:44
That shouldn't be the case, unless you are using an old version of MPC-HC. That behavior of enabling the ISR on-the-fly when disabled in settings, with VSFilter already loaded, was removed in MPC-HC 1.7.5+ IIRC. Though I guess you are saying you had XySubFilter disabled in those instances, rather than idle.
I'm using the latest build. So is there no reason now not to clear "Use the built-in subtitle renderer" checkbox - 'cause you may use ISR anyway as well as get VSFilter-like filters working?
GCRaistlin
21st July 2014, 16:47
Though I guess you are saying you had XySubFilter disabled in those instances, rather than idle.
"Disabled" means "added to External Filters list and set to Block"? No I didn't disable XySubFilter this way. It's just registered and none of its settings are changed from the default state.
cyberbeing
21st July 2014, 17:57
.vob files don't have any palette at all, so LAV provides a default palette, since many renderers otherwise just used to output everything in black. How can this be incorrect?
Only in the sense that the default palette from LAV produces extremely strange colors with DVD subtitles which originally had a colored palette.
LAV sends a palette of:
palette: 000000,e0e0e0,808080,202020,3333fa,1111bb,fa3333,bb1111,33fa33,11bb11,fafa33,bbbb11,fa33fa,bb11bb,33fafa,11bbbb
Which results in the following with VSFilter and MPC-HC ISR on a couple DVDs I tested:
http://i.imgbox.com/HRjE86ss.pnghttp://i.imgbox.com/VcxmrzJY.png
The first was originally Green Body / Black Border, while the second was originally Yellow Body / Black Border.
MPC-BE's MPEG-2 splitter appears to extract the orignal DVD palette from the IFO if present in the same directory as the VOB. LAV gaining a feature like this would probably be nice.
Though it seems the MPC-BE splitter does not function at all with xy-VSFilter when the IFO is missing. MPC-BE does send a default palette via "custom colors: on" in this case, but they don't set "palette:" which causes the header to be rejected. MPC-BE added special logic to handle this in their version of VSFilter though. We probably should patch in something similar, since "custom colors: on" being set results in "palette:" being ignored anyway.
You can accept the DVD type instead of the vobsub type if you want, which doesn't include any palette at all.
If you think this is the preferred solution, you should ask the MPC-HC devs to implement this.
I'm using the latest build. So is there no reason now not to clear "Use the built-in subtitle renderer" checkbox - 'cause you may use ISR anyway as well as get VSFilter-like filters working?
Not exactly.
"Disabled" means "added to External Filters list and set to Block"? No I didn't disable XySubFilter this way. It's just registered and none of its settings are changed from the default state.
By "Disabled" I only mean not active/loaded in the graph. If "use built-in subtitle renderer" is DISABLED, MPC-HC will only enable the ISR on-the-fly when VSFilter/XySubFilter is NOT Present in the graph. By default, when "Load when Needed" is set, VSFilter/XySubFilter will only be loaded into the graph when subtitles can be auto-loaded. If you set "Always Load", VSFilter/XySubFilter will always be loaded into the graph even when NO subtitles can be auto-loaded.
Asmodian
22nd July 2014, 23:41
Are there any known Issues with xySubFilter and 4K? I am having trouble with complex ass scripts and 4K and want to make sure there isn't a known issue before generating a bug report. :o
DarkSpace
23rd July 2014, 00:59
Are there any known Issues with xySubFilter and 4K? I am having trouble with complex ass scripts and 4K and want to make sure there isn't a known issue before generating a bug report. :o
I think it's simply a memory problem, since you mentioned that the ASS scripts are complex. I think that's also the reason that no new RC has been released yet (optimizing memory consumption for higher-resolution output), but I guess that someone else may know better about that.
cyberbeing
23rd July 2014, 01:09
Issues at 4K would probably include the risk of running out of memory, the default cache limit of 512MB possibly being too low to function effectively, and just general poor performance from the higher computation load of rendering objects at 4K with 8x8 supersampling.
You could try increasing the default cache MB limit, and then playing with the madVR CPU queue while monitoring the peak "Virtual Memory" usage with something like Process Explorer to ensure your media player is not coming close to the 32-bit process memory limit. Though keep in mind that the cache MB limit only controls the cache. Memory usage for scanline conversion and rasterization is automatic and cannot be controlled.
Though unless you have an extremely fast CPU, you may just be out of luck. Overall performance may just be too slow currently to handle the most intensive scripts @4K. Fansubbers nowadays are making some pretty crazy stuff with advanced frame-by-frame motion tracking, automated image to vector/clip tracing, lua scripted 3d transforms and effects, and so on, resulting in extremely complex line heavy scripts.
Asmodian
23rd July 2014, 03:42
Issues at 4K would probably include the risk of running out of memory, the default cache limit of 512MB possibly being too low to function effectively, and just general poor performance from the higher computation load of rendering objects at 4K with 8x8 supersampling.
You could try increasing the default cache MB limit, and then playing with the madVR CPU queue while monitoring the peak "Virtual Memory" usage with something like Process Explorer to ensure your media player is not coming close to the 32-bit process memory limit. Though keep in mind that the cache MB limit only controls the cache. Memory usage for scanline conversion and rasterization is automatic and cannot be controlled.
Thanks, you are both right.
I set LargeAddressAware on zplayer.exe and changed the cache from default -1 (511) to 1024; all issues went away. Zoom Player uses ~2.3GB of memory at most. :)
After these changes watching Process Explorer the memory usage jumps by ~600MB when the subs are being displayed.
On an i7 3770K @ 4.6 GHz no cores are over ~50% during the subs, but it is easy to see them on the CPU graph.
Interestingly running out of memory didn't result in a crash, instead the luma stalled while the chroma kept playing leading to an odd effect. It was slow and choppy too.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.