如何在 Windows 7 上通过 DirectShow 播放 MPEG-TS 视频?
我们的应用程序使用 IGraphBuilder::RenderFile
来构建过滤器图。在Windows 7上,该应用程序可以流畅地播放MPEG-PS视频,但无法打开/播放MPEG-TS(传输流)视频。 IGraphBuilder::RenderFile
返回错误代码VFW_E_UNSUPPORTED_STREAM
。
在我的 Windows 7 上,Windows Media Player 可以打开/播放这些 MPEG-TS HDV 视频。
我的问题是:
- 是否可以在 Windows 7 上通过 DirectShow 加载/播放 MPEG-TS 视频,而仅使用 Windows 7 安装的过滤器?因为我们最好不要要求用户安装一些第三方的DirectShow过滤器。
- 如果不可能,是否有一些流行的编解码器可以处理 MPEG-TS HDV,并且最多也适合 DirectShow。
我尝试过的更多细节:
我还在 Windows SDK 中尝试了 GraphEdit。打开这些 MPEG-TS 视频时出现同样的错误。
如果我添加一个 MPEG-TS 视频作为
文件源(异步)
,其输出引脚会被标记为主要类型:Stream,子类型:GUID_NULL
,并且无法连接到其他过滤器,例如 MPEG-2 解复用器。更沮丧的是,MSDN 说< code>MPEG-2 解复用器 对 MPEG-2 传输流和节目流进行解复用。
所以,我很可能错过了一些东西。经过几天的挖掘,我现在对这个问题非常绝望。欢迎并赞赏任何建议。
感谢
粉丝
Our application uses IGraphBuilder::RenderFile
to build filter graph. On Windows 7, this application can play MPEG-PS videos smoothly, but it cannot open/play MPEG-TS(transport stream) videos. IGraphBuilder::RenderFile
returns an error code VFW_E_UNSUPPORTED_STREAM
.
On my Windows 7, Windows Media Player can open/play those MPEG-TS HDV videos.
My questions are:
- Is it possible to load/play MPEG-TS videos by DirectShow on Windows 7, with only filters installed by Windows 7? Because it is best for us not to ask users to install some third-party DirectShow filters.
- If it is impossible, is there some popular codecs that can handle MPEG-TS HDV, and also fit in DirectShow at best.
Some more details I've tried:
I also tried GraphEdit in Windows SDK. It gave the same error when opening those MPEG-TS videos.
If I added one MPEG-TS video as a
File Source(Async)
, its output pin was marked asMajor Type: Stream, SubType: GUID_NULL
, and cannot be connected to other filters, such asMPEG-2 Demultiplexer
.More frustrated, MSDN says
MPEG-2 Demultiplexer
does demultiplex both of MPEG-2 transport and program streams.
So, it is very likely that I missed something. After days of digging, I am now very desperate on this problem now. Any advices are welcome and appreciated.
Thanks
Fan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法将文件源(异步)连接到 MPEG-2 解复用器的原因是文件源以拉取模式运行,而 MPEG-2 解复用器仅支持推送模式下的 TS。
Haali 媒体分配器可以解复用 MPEG-2 TS。如果您不想强迫用户安装它,也许您可以编写一个简单的推送型文件源过滤器并将其手动插入到您的图表中。
The reason why you can't connect File Source (Async) to MPEG-2 Demux is that the file source operates in pull mode and the MPEG-2 demux only supports TS in push mode.
Haali media splitter can demux MPEG-2 TS. If you don't want to force users to install it, maybe you can write a simple push-type file source filter and insert it manually into your graph.