Search code examples
videodirectshowdirectshow.netsubtitle

Is there any way to control DirectShow VSFilter programmatically?


I'm trying to set up a subtitles file to DirectShow VSFilter programmatically. There is a way to do so through its property pages but I can't find any documentation regarding its API or even if it has one.

Is there any sort of API, Interop, anything which would allow to set up a subtitle file for VSFilter?


Solution

  • There is no specific documentation on VSFilter, however it's open source software. So you can download source code, reference its interface definition e.g. in MPC-HC source \Mpc-hc\src\filters\transform\vsfilter\IDirectVobSub.h and use the interface to control the filter programmatically.

        interface __declspec(uuid("EBE1FB08-3957-47ca-AF13-5827E5442E56"))
    IDirectVobSub : public IUnknown 
        {
            STDMETHOD(get_FileName) (THIS_
                        WCHAR* fn   // fn should point to a buffer allocated to at
                                    // least the length of MAX_PATH (=260)
                     ) PURE;
    
            STDMETHOD(put_FileName) (THIS_
                        WCHAR* fn
                     ) PURE;
    // ...