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

前端 未结 4 1841
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-25 09:19

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 resol

4条回答
  •  渐次进展
    2021-01-25 09:41

    The Solution is (With my knowledge)

         VideoCaptureDevice webcam = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
    
     int videoformatcount = webcam.SupportedFormats.Count(); //We will get the avilable video format
    
      if (videoformatcount > 0)
                 {
                    var Temp = webcam.SupportedFormats;
    
                    VideoFormat objVideoFormat = Temp[videoformatcount - 1];
    
                    webcam.DesiredFormat = new VideoFormat(PixelFormatType.Format8bppGrayscale, objVideoFormat.PixelWidth, objVideoFormat.PixelHeight, 1);
                }
    
    captureSource.VideoCaptureDevice = webcam;
    

    This will produce the lowest resolution video

提交回复
热议问题