控制 DirectShow 中的宽高比(全屏模式)
我通过简单的方法(IGraphBuilder RenderFile)使用 DirectShow,并尝试通过查询补充接口来控制其他一切。
有问题的选项是纵横比。我以为它是默认维护的,但实际上同一个程序在不同的机器上(可能是 DirectX 的版本)表现不同。对于窗口中的视频来说这不是一个大问题,因为我可以自己维护窗口的宽高比(基于视频大小),但对于全屏模式我不明白如何控制。
我发现至少有两个复杂的选项:用于 VMR 视频和添加叠加混合器,但是是否有已知的方法可以为 IGraphBuilder 的 RenderFile 视频执行此操作?
I'm using DirectShow with a simple approach (IGraphBuilder RenderFile) and try to control everything else with querying supplemental interfaces.
The option in question is aspect ratio. I thought that it is maintained by default, but actually the same program behaves differently on different machines (maybe versions of DirectX). This is not a huge problem for a video in a window, because I can maintain the aspect ratio of my window by myself (based on the video size), but for full-screen mode I can not understand how can I control.
I found that there are at least two complex options: for VMR video and with adding overlay mixer, but is there a known way for doing this for IGraphBuilder' RenderFile video?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您执行 IGraphBuilder::RenderFile 时,它会在内部向图形添加视频渲染器过滤器。它通常是 VMR-7 视频渲染过滤器< /a>:
此时,您可以枚举图形的过滤器、找到 VMR-7 并使用其接口,例如 IVMRAspectRatioControl 指定感兴趣的模式。
When you do IGraphBuilder::RenderFile, it internally adds a video renderer filter to the graph. It is typically a VMR-7 Video Renderer Filter:
At this point you can enumerate graph's filters, locate VMR-7 and use its interfaces such as IVMRAspectRatioControl to specify mode of interest.