directshow“色彩空间转换器”过滤器配置问题(VMR无窗口渲染器)

发布于 2024-11-17 00:25:36 字数 859 浏览 1 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹短裙飘 2024-11-24 00:25:36

据我所知,色彩空间转换器过滤器没有接口,但您也不需要它。您可以通过插入仅接受 RGB32 的滤镜来强制“色彩空间转换器”滤镜转换为 RGB32。 RGBFilters 示例中的 TransNull32 确实做到了这一点。您的图表将如下所示:

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

另请参阅关于范围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:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文