如何翻转/镜像/转换来自媒体基金会 IMFVideoDisplayControl 的网络摄像头视频?

问题描述

我正在使用来自 sipsorcery/mediafoundationsamples 的示例来显示来自网络摄像头的视频。

创建 IMFVideodisplayControl 对象后,我尝试设置视频输出的变换:

IMfgetService* pService;
IMFVideodisplayControl* pVideodisplayControl;
//...
pService->GetService(MR_VIDEO_RENDER_SERVICE,__uuidof(IMFVideodisplayControl),(void**)&pVideodisplayControl);
// try to flip my video output here
MFVideonormalizedRect* pSourceRect = new MFVideonormalizedRect();
pSourceRect->left = 1;
pSourceRect->right = 0;
pSourceRect->top = 0;
pSourceRect->bottom = 1;
pVideodisplayControl->SetVideoPosition(pSourceRect,nullptr)

SetVideoPosition 如果我试图翻转 x 坐标,这里会给出错误 E_INVALIDARG。

我也尝试使用 IAMCameraControl获取/设置相机的属性,但没有我可以使用的此类属性

IMFMediaSource* pVideoSource;
// ...
CComQIPtr<IAMCameraControl> spCameraControl(pVideoSource);
long min,max,step,def,control;
HRESULT hr = spCameraControl->GetRange(CameraControl_Pan,&min,&max,&step,&def,&control);
// hr returns ERROR_NOT_FOUND

问题:

如何正确翻转或转换视频输出

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)