简体   繁体   中英

DirectShow SampleGrabber changes the ratio of image source

I built a graph to grab both audio and video from a BDA DVB-T Tuner using DirectShow.

If I build my graph like that :

... -> MPEG2 Demux -> BDA MPEG2 Transport Information Filter
                   -> MPEG2 Sections And Tables
                   -> Video Mixing Renderer 9

The output on the renderer will be ok.

In my case :

... -> MPEG2 Demux -> BDA MPEG2 Transport Information Filter
                   -> MPEG2 Sections And Tables
                   -> SampleGrabber -> Video Mixing Renderer 9

The SampleGrabber changes the image ratio. Both the SampleGrabber and the renderer display some wrong images.

I read on several topics that "SampleGrabber" can't handle dynamic formats change sent by previous filters because of the "VideoInfoHeader" structure.

So, If the source changes the ratio, the image will be wrong in the SampleGrabber.

What is the solution to get real images in/out the SampleGrabber without doing my own CustomSampleGrabber based on "DirectX February 2004" samples ?

It is likely that video stream is not compatible with Sample Grabber (interlaced etc.) and then another filter is being inserted into pipeline to resolve the connectivity. You should inspect the topologies you create and check media types to get better understanding what is going on and, yes, most likely you will have to implement alternate grabbing method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM