best way to build graph for MPEG2 transport stream

浪子不回头ぞ 提交于 2019-12-09 01:39:12

问题


on windows 7 the windows media player supports .ts files very well, in the sense that windows media player knows how to handle such files without any additional codec packs.

however if I try to use graphedit to "render" a .ts file, it complains it doesnt know how to build a graph for it.

what method does windows media player use to demux/decode these files? is it directshow? windows media foundation? BDA? Microsoft TV Technologies? unified tuning model?

whatever the method they use, is available as an API to be used in my custom application?


回答1:


In DirectShow using only Microsoft filters it can be a bit of a mess. The Mpeg2 Demultiplexer needs to be manually configured through code using the IMpeg2Demultiplexer interface or through the property pages to add output pins for the content streams. Normally you would need to connect something else to the filter to parse the PSI/PAT information and identify the program ids of the content streams inside the transport stream. Microsoft provides an SDK sample to do this in the Windows Platform SDK.

This is assuming that you have a regular mpeg2 transport stream file. You can use the free apps MediaInfo or TsReader Lite to see exactly what is in your ts file.

There are non-Microsoft filters that make handling transport streams in DirectShow a lot easier. The combination of the open source filters Haali Media Splitter and Ffdshow will do it without any extra configuration. Or commercial filter packages from MainConcept, Elecard, LEADTools, etc.

I haven't done much hands-on work with Media Foundation, so I don't have much advice to offer on that front. Newer versions of Windows Media Player use MF instead of DirectShow. Some, but not all, new MF functionality is also exposed through DirectShow interfaces.




回答2:


I'm not sure of the method used by Windows Media Player.

I've used DirectShow to build a graph. From the source, you can add an MPEG-2 Demultiplexer, create the Audio and Video pins (using the IMpeg2Demultiplexer interface), then hook the Audio pin to the "Microsoft DTV-DVD Audio Decoder" and the Video pin to the "Microsoft DTV-DVD Video Decoder". You can then feed the outputs into an audio and a video renderer.

For example, here is part of a graph I have used:

David



来源:https://stackoverflow.com/questions/5078713/best-way-to-build-graph-for-mpeg2-transport-stream

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