Search code examples
camerawindows-phone-8windows-phoneresolutionvideo-recording

How to change the resolution of camera while recording video in WP8


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.


Solution

  • Second parameter for AudioVideoCaptureDevice.OpenAsync is the resolution. And you can get the resolutions using AudioVideoCaptureDevice.GetAvailableCaptureResolutions(sensor).