如何解决如何翻转/镜像/转换来自媒体基金会 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 举报,一经查实,本站将立刻删除。