Question about setting up FIle Writer in C#

大兔子大兔子 提交于 2019-12-23 09:26:32

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6416957/question-about-setting-up-file-writer-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!