directshow“色彩空间转换器”过滤器配置问题(VMR无窗口渲染器)
我正在使用 VMR 将位图与视频流混合。我在无窗口模式下运行渲染器。
由于渲染器上需要有超过 1 个流,因此我首先将渲染器添加到图表中,然后将 IFilterGraph2::RenderEx 与 AM_RENDEREX_RENDERTOEXISTINGRENDERERS 结合使用。
大多数时候一切都工作正常,但我有一个 .avi 文件可以使用 RenderFile 很好地渲染,但在我的图表中渲染时最终显示为全黑。我在 graphedit 中比较了这两个图表,它们是相同的:
capture.avi -> AVI Splitter -> Color Space Converter -> Video Renderer
图表之间的唯一区别是颜色空间渲染器的设置不同:graphedit 显示图表中的以下设置有效:
Input:
Major Type: Video
Sub Type: ARGB32
...
XForm Out:
Major Type: Video
Sub Type: RGB32
而在我的图表中它显示:
Input: (same)
XForm Out:
Major Type: Video
Sub Type: ARGB32
所以看起来转换器基本上什么也没做。我环顾四周,找不到颜色空间转换器过滤器的任何配置界面。我还在 VMR 输入引脚和色彩空间转换器输出引脚上使用 IPin::QueryAccept 和 IFilterGraph2::ReconnectEx 尝试了不同的操作,以尝试强制转换器过滤器的输出为 RGB32,但我没有太多运气。希望这里有人能指出我正确的方向!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,色彩空间转换器过滤器没有接口,但您也不需要它。您可以通过插入仅接受 RGB32 的滤镜来强制“色彩空间转换器”滤镜转换为 RGB32。 RGBFilters 示例中的 TransNull32 确实做到了这一点。您的图表将如下所示:
另请参阅关于范围DirectShow 中的示例抓取器,其中我解释了如何使用 TransNull24 过滤器。
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:
See also Regarding the scope of Sample Grabber in DirectShow where I explaind how to use the TransNull24 filter.