在WP8中录制视频时如何更改相机的分辨率 [英] How to change the resolution of camera while recording video in WP8
问题描述
我正在使用Microsoft 此处.我想更改在我的应用中录制的视频的分辨率.当前,默认情况下以最高分辨率录制.怎么做?
I am using the video recording sample provided by microsoft here. I want to change the resolution of the video being recorded in my app. Currently its recording in highest resolution by default. How to do so?
videoCaptureDevice.DesiredFormat = new VideoFormat(PixelFormatType.Unknown, 480, 640, 30);
上面的语句引发参数异常.
The above statement is throwing Argument Exception.
还有,如果可能的话,让我知道如何从前置摄像头捕捉到图像?
Also, if possible let me know how to capture from the front camera?
如何实现这一目标?请帮忙.
How to achieve this? Please help.
推荐答案
AudioVideoCaptureDevice.OpenAsync
的第二个参数是分辨率.您可以使用AudioVideoCaptureDevice.GetAvailableCaptureResolutions(sensor)
获得分辨率.
Second parameter for AudioVideoCaptureDevice.OpenAsync
is the resolution. And you can get the resolutions using AudioVideoCaptureDevice.GetAvailableCaptureResolutions(sensor)
.
这篇关于在WP8中录制视频时如何更改相机的分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!