MediaCapture Windows 8 Desktop - Photo is Dark

雨燕双飞 提交于 2019-12-06 12:07:46

Late reply, but in case that helps folks in the future: dark pictures are often due to the lack of video preview. Camera drivers use the preview stream to run their 3A algorithms (auto-whitebalance/focus/exposure). At the moment getting MediaCapture to preview in Desktop apps is a bit challenging. One way to do it is to create a D3DImage and rely on some native interop to call Media Foundation and DirectX. It is not trivial but can be encapsulated so the C# API surface remains simple. Here is some code sample: https://github.com/mmaitre314/MediaCaptureWPF

You can try to change your media settings as following, it should be better:

settings.StreamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.AudioAndVideo;
settings.PhotoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.VideoPreview;
iwanlenin
await mc.InitializeAsync(new MediaCaptureInitializationSettings {
    PhotoCaptureSource = PhotoCaptureSource.VideoPreview }
);

is the solution.

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