directshow “Color Space Converter” filter configur

2019-08-03 13:00发布

I'm using VMR to mix a bitmap with a video stream. I run the renderer in windowless mode.

Since I need to have more than 1 stream on the renderer, I add the renderer to the graph first and then use IFilterGraph2::RenderEx with AM_RENDEREX_RENDERTOEXISTINGRENDERERS.

Everything works fine most of the time, but I have one .avi file that will render fine with RenderFile, but ends up displaying all black when rendered in my graph. I compared the two graphs in graphedit, and they're the same:

capture.avi -> AVI Splitter -> Color Space Converter -> Video Renderer

The only difference between the graphs is that the Color Space Renderer is setup differently: graphedit shows that the following settings in the graph that works:

Input:
    Major Type:  Video
    Sub Type: ARGB32
    ...
XForm Out:
    Major Type: Video
    Sub Type: RGB32

Whereas in my graph it shows:

Input:  (same)
XForm Out:
    Major Type: Video
    Sub Type: ARGB32

So it looks like the converter is basically doing nothing. I have looked around and was not able to find any configuration interface for the Color Space Converter filter. I've also tried different things with IPin::QueryAccept and IFilterGraph2::ReconnectEx on the VMR input pin and the Color Space Converter output pin to try and force the output of the Converter filter to RGB32, but I haven't had much luck. Hopefully somebody here can point me in the right direction!

1条回答
Root(大扎)
2楼-- · 2019-08-03 13:29

As far as I know the Color Space Converter filter does not have an interface, but you don't need it either. You can force the Color Space Converter filter to convert to RGB32 by inserting a filter which only accepts RGB32. The TransNull32 from the RGBFilters example does exaclty this. Your graph will look like this:

capture.avi -> AVI Splitter -> Color Space Converter -> TransNull32 -> Video Renderer

See also Regarding the scope of Sample Grabber in DirectShow where I explaind how to use the TransNull24 filter.

查看更多
登录 后发表回答