Search code examples
c#videostreamingdirectshowdirectshow.net

Set filename to Lav Splitter Source filter


I am able to render RTP stream over 234.5.6.7:2000 using Lav Splitter Source filter in GraphStudio. When I add the filter, GraphStudio asks for filename or URL as input. That is how I render RTP stream, buth how can I do it in code?

For writing file, I used to do so:

(fileWriter as IFileSinkFilter).SetFilename("c:\\a.avi",null);

But it is source filter. How should I set filename/URL for source filter (Lav Splitter Source)?


Solution

  • LAV Splitter (and file source filters) should support IFileSourceFilter interface. So you just do:

    (lavSplitter as IFileSourceFilter).Load("c:\\a.avi", null); 
    

    You can use URL instead of filename here. Also you have to check and handle the HRESULT code of Load().