使用 WMA sf 过滤器写入 .wmv 文件

发布于 2024-09-05 13:24:45 字数 554 浏览 1 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千仐 2024-09-12 13:24:45

您在这里所做的就是创建一个 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文