best way to build graph for MPEG2 transport stream

怎甘沉沦 提交于 2019-11-30 23:33:57

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.

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

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