Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question about setting up FIle Writer in C#

Im using DirectShowLib in C#. I want to use File Writer in C# to set a file output. I want to use File Writer because Graph.SetOutputFileName() wont connect to my encoder, but File Writer will. How can i set the File that File Writer saves to in C#?

I tried pulling up its property pages like in the DxPropPages example but one won't come up for File Writer.

like image 822
Grant Avatar asked Jun 20 '11 20:06

Grant


1 Answers

Pulled from here

IBaseFilter ibf = new FileWriter() as IBaseFilter;

Update:

"I know how to add file writer to my graph in code i just dont know how to set the file path"

try the following:

FileWriter fileWriter = new FileWriter();
IFileSinkFilter fileSinkFilter = (IFileSinkFilter)fileWriter;
fileSinkFilter.SetFileName(fileOutput, null);

Here a useful link that shows a full running example. the example is demonstrating the use of DES but you should get the general idea from it.

like image 113
Jalal Said Avatar answered Oct 07 '22 02:10

Jalal Said