Directshow - issues, compatibility, and a memory leak (1 Viewer)

mr.duck

Portal Member
December 31, 2008
44
2
There seems to be several issues with the media portal directshow filters. My hope is for this thread to get developers to look into it and fix the problems.


1) Playing a TS file in potplayer with the mediaportal filters causes the program to start using every GB of available RAM until it eventually crashes. I found that the cause is "DVBSub2.ax". Without it there is no memory leak. As soon as it is added while keeping everything else the same... memory leak.


2) The filters behave in unusual ways that cause problems in the directshow framework. To quote the zoom player dev:
[The TSFileReader] audio pin exposes data that can be identified as video. ... with the modification I added, the pin will be scanned for both audio and video. The same for the subtitle. They could output subtitle in a way that is compatible with other subtitle renderers (VobSub for example), but what they do require their custom subtitle filter.
Can TSFileSource be fixed at least for the audio/video/subtitle pins to be identified as such? Can changes be made so that custom code *is not* required in each video player in order to support the directshow filters??


3) There is a further compatibility issue with TSFileSource regarding seeking on resuming files. It seems that the filter isn't accepting the seek command right at the start of playback. Again this is something that only the mediaportal filters have issue with and have probably rather unfortunately been fixed in the mediaportal application rather than in the filter themselves.
 

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    get developers to look into it and fix the problems.

    Just a brief generic comment - MediaPortal directshow filters are designed to work with MediaPortal. If they are having issues with some 3rd party applications alone it is highly unlikely to be changed. No one is forcing those filters to be used in a 3rd party application. There are several "not-the-standard-way" design choices done (like the DVB subtitle filter feeds data directly to the GUI engine to allow DXVA used).

    1) Playing a TS file in potplayer with the mediaportal filters causes the program to start using every GB of available RAM until it eventually crashes. I found that the cause is "DVBSub2.ax". Without it there is no memory leak. As soon as it is added while keeping everything else the same... memory leak.

    DVBSub2.ax probably caches the subtitle bitmaps and no one is querying those. Not a memory leak. PotPlayer doesn't have correct interfaces implemented, so either it needs to be implement those or the DVBSub2.ax shouldn't be connected in the graph.

    2) The filters behave in unusual ways that cause problems in the directshow framework. To quote the zoom player dev:
    [The TSFileReader] audio pin exposes data that can be identified as video. ... with the modification I added, the pin will be scanned for both audio and video. The same for the subtitle. They could output subtitle in a way that is compatible with other subtitle renderers (VobSub for example), but what they do require their custom subtitle filter.
    Can TSFileSource be fixed at least for the audio/video/subtitle pins to be identified as such? Can changes be made so that custom code *is not* required in each video player in order to support the directshow filters??

    TsReader.ax exposes the subtitle pin content as Transport Stream. DVBSub2.ax consumes Transport Stream and internaly parses the PES packets out of it. As far as I know VobSub wont have DVB subtitle support. There is no planned changes to output the DVB subtitles in any other format than as a RAW Trasport Stream.

    3) There is a further compatibility issue with TSFileSource regarding seeking on resuming files. It seems that the filter isn't accepting the seek command right at the start of playback. Again this is something that only the mediaportal filters have issue with and have probably rather unfortunately been fixed in the mediaportal application rather than in the filter themselves.

    Please provide a patch / fix and we can consider if it is good to be included.
     

    mr.duck

    Portal Member
    December 31, 2008
    44
    2
    Just a brief generic comment - MediaPortal directshow filters are designed to work with MediaPortal. If they are having issues with some 3rd party applications alone it is highly unlikely to be changed. No one is forcing those filters to be used in a 3rd party application. There are several "not-the-standard-way" design choices done (like the DVB subtitle filter feeds data directly to the GUI engine to allow DXVA used).
    Playing a TS file is a deceptively simple challenge. The number of TS filters that can open a TS file adequately is an extremely short list. The mediaportal filter is the only one I have found that can do it and do it well. The only one!


    DVBSub2.ax probably caches the subtitle bitmaps and no one is querying those. Not a memory leak. PotPlayer doesn't have correct interfaces implemented, so either it needs to be implement those or the DVBSub2.ax shouldn't be connected in the graph.
    I see. But what I don't understand is when I try using ffdshow for video, why can't the subtitles from DVBSub2.ax be displayed as ffdshow supports picture based subtitles?


    TsReader.ax exposes the subtitle pin content as Transport Stream. DVBSub2.ax consumes Transport Stream and internaly parses the PES packets out of it. As far as I know VobSub wont have DVB subtitle support. There is no planned changes to output the DVB subtitles in any other format than as a RAW Trasport Stream.
    I see. But what about the audio pin? Is that also identified as transport stream or is it identified as video?


    Please provide a patch / fix and we can consider if it is good to be included.
    I love open source. But I have never written a line of C++ in my life. I would gladly make the changes and contribute if I could. I had my fingers crossed when I made this thread that someone that knows what they are doing would make the fixes for me.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    3) There is a further compatibility issue with TSFileSource regarding seeking on resuming files. It seems that the filter isn't accepting the seek command right at the start of playback. Again this is something that only the mediaportal filters have issue with and have probably rather unfortunately been fixed in the mediaportal application rather than in the filter themselves.

    How do you trigger/reproduce the problem ?

    Have you got a TsReader.log that shows the problem ?

    Tony

    (and by the way, it's not hard to find problems in some non-MP filters - a little while ago I was doing some fast-forward testing, and discovered how easily you could crash/hang some well known splitter filters...... ;)
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    2) The filters behave in unusual ways that cause problems in the directshow framework. To quote the zoom player dev:
    [The TSFileReader] audio pin exposes data that can be identified as video. ... with the modification I added, the pin will be scanned for both audio and video. The same for the subtitle. They could output subtitle in a way that is compatible with other subtitle renderers (VobSub for example), but what they do require their custom subtitle filter.
    Can TSFileSource be fixed at least for the audio/video/subtitle pins to be identified as such? Can changes be made so that custom code *is not* required in each video player in order to support the directshow filters??

    Can you point me at the forum discussion thread that the quote is taken from (or post all the information from the 'zoom player dev') so we know the context of how TsReader is being used, how the graph is being built etc ?

    Tony
     

    mr.duck

    Portal Member
    December 31, 2008
    44
    2
    How do you trigger/reproduce the problem ?

    Have you got a TsReader.log that shows the problem ?

    Tested with zoom player and pot player with identical results:

    Play a TS file for a bit. Close it. Play same file again. The mediaplayer tries to resume the file from the same point it was at when it was closed. The timeline shows that this is the case, but the video is always from the very beginning.

    I don't have a log. I would need a debug TSReader.ax for that?


    Can you point me at the forum discussion thread that the quote is taken from (or post all the information from the 'zoom player dev') so we know the context of how TsReader is being used, how the graph is being built etc ?
    It's in a 'closed beta' section of a forum (password protected). TsReader was set as the preferred source filter/splitter. Specific audio and video filters were also set to be used. If everything worked, the file will play; otherwise it would give an error that it could not be played. I'm not sure if this adequately answers your question. I could always try to invite the zoom player dev to this thread if it doesn't...
     

    mr.duck

    Portal Member
    December 31, 2008
    44
    2
    Please provide a patch / fix and we can consider if it is good to be included.
    It seems I'm going to have to learn C++

    - I've installed Visual Studio 2010 Express.
    - I downloaded the code bits (some 20 files) for DVBSub2.ax one by one (is there a better way to do it?)
    - I opened the project and click on 'build'
    - Getting an error like: 'streams.h' There is no such file or directory.

    What to do? Way out of my depth here.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Please provide a patch / fix and we can consider if it is good to be included.
    It seems I'm going to have to learn C++

    - I've installed Visual Studio 2010 Express.
    - I downloaded the code bits (some 20 files) for DVBSub2.ax one by one (is there a better way to do it?)
    - I opened the project and click on 'build'
    - Getting an error like: 'streams.h' There is no such file or directory.

    What to do? Way out of my depth here.

    You should copy the whole GIT repository (there are other files needed as well).

    4_Development

    Some steps you need to make to be able to compile directshow filters:

    1. Update to the latest Windows SDK (previously the Platform SDK).
    http://www.microsoft.com/downloads/...A4-741A-433A-9BE5-FA919850BDBF&displaylang=en

    2. Update to the latest DirectX SDK
    http://msdn2.microsoft.com/en-us/directx/aa937788.aspx

    3. Navigate to the Windows SDK -> vX.X -> Samples -> Multimedia -> DirectShow -> BaseClasses

    4. Open the BaseClasses solution.

    a. Ensure the linking type is multithreaded dll (for Release_MBCS) or multithreaded debug dll (for Debug_MBCS)

    b. Build both Release_MBCS and Debug_MBCS

    5. Set up the environmental variables as follows (your paths may vary)

    Variable name = WINDOWS_SDK Value = C:\Program Files\Microsoft SDKs\Windows\vX.X\

    Variable name = DXSDK_DIR Value = C:\Program Files\Microsoft DirectX SDK (YYYYYYY XXXX)\

    Variable name = DSHOW_BASE Value = C:\Program Files\Microsoft SDKs\Windows\vX.X\Samples\Multimedia\DirectShow\BaseClasses\
     

    Users who are viewing this thread

    Top Bottom