如何在VMR9无渲染模式下将视频调整为指定大小? [英] How can I adjust the video to a specified size in VMR9 renderless mode?

查看:157
本文介绍了如何在VMR9无渲染模式下将视频调整为指定大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要调整视频以使其显示在指定的窗口上,例如320 * 240。

I want to adjust the video to display on a specified window, for example 320*240.

我必须使用VMR-9无渲染模式渲染到表面。
我正在使用IVMRMixerControl9-> SetOutputRect()方法来调整视频大小。
所以我必须获得本地视频的大小。但是我不知道如何。

I must use VMR-9 Renderless mode to render to a surface. I am using the IVMRMixerControl9->SetOutputRect() method to adjust the video size. So I must get the native video size. But I don't know how.

GetOutputRect方法始终返回0和1。
get_VideoHeight和get_VideoWidth方法返回E_NOINTERFACE。但是我确实用视频文件构建了filterGraph。

The GetOutputRect method always return 0 and 1. The get_VideoHeight and get_VideoWidth method return E_NOINTERFACE. But I do build a filterGraph with a video file.

我有错误的主意还是有其他方法?

Do I have the wrong idea or there are other method?

请先感谢!

推荐答案

不确定是否可以帮到您,但是您是否看过VMR的无窗口模式?您可以指定用于显示视频的窗口的句柄(例如UserControl)。在IVMRWindowlessControl9接口上,可以调用GetNativeVideoSize来获取本机窗口大小并从此处设置大小,然后调用SetVideoPosition来指定视频的位置。就我而言,我使用UserControl的ClientRectangle作为目标矩形,使用本机视频大小作为源矩形。

Not sure if this would help you, but have you looked at the VMR's windowless mode? You can specify the handle for a window (such as a UserControl) to show the video. On the IVMRWindowlessControl9 interface, you can call GetNativeVideoSize to get the native window size and set the size from there and then call SetVideoPosition to specify where the video should go. In my case, I am using the ClientRectangle of the UserControl as the destination rectangle and the native video size as the source rectangle.

这篇关于如何在VMR9无渲染模式下将视频调整为指定大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆