How can I adjust the video to a specified size in VMR9 renderless mode?

孤街浪徒 提交于 2019-12-23 04:18:08

问题


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

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.

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?

Thanks in advance!


回答1:


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.



来源:https://stackoverflow.com/questions/4989273/how-can-i-adjust-the-video-to-a-specified-size-in-vmr9-renderless-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!