使用 WMA sf 过滤器写入 .wmv 文件
我正在尝试使用 WM Asf writer 过滤器创建输出 .wmv 文件。这是我的代码。
IBaseFilter* pASFWriter; CoCreateInstance(CLSID_WMAsfWriter,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**) (&pASFWriter));
pGraphBuilder->AddFilter(pASFWriter,L"FileWriter");
IFileSinkFilter *pSink2=NULL;
pASFWriter->QueryInterface(IID_IFileSinkFilter,(void**)&pSink2); pSink2->SetFileName(OUTFILENAME,NULL);
以上所有内容都返回 S_OK,但是没有创建文件。我无法理解为什么会这样?
I am trying to create an output .wmv file using WM Asf writer filter.Here is my code .
IBaseFilter* pASFWriter;
CoCreateInstance(CLSID_WMAsfWriter,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**) (&pASFWriter));
pGraphBuilder->AddFilter(pASFWriter,L"FileWriter");
IFileSinkFilter *pSink2=NULL;
pASFWriter->QueryInterface(IID_IFileSinkFilter,(void**)&pSink2);
pSink2->SetFileName(OUTFILENAME,NULL);
All of the above return S_OK however there is no file created .I am not able to understand why this is so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在这里所做的就是创建一个 DirectShow 过滤器并将其设置为写入文件。在过滤器连接到为其提供数据的其他过滤器并且运行图形之前,不会发生任何事情。在收到第一个有效数据之前,不会创建文件。
有关详细信息,请参阅此 MDSN 主题。
All you're doing here is creating a DirectShow filter and setting it up to write to a file. Nothing will happen until the filter is connected to other filters that supply it with data and the graph is run. The file won't be created until the first valid data is received.
See this MDSN topic for more information.