[UWP] Capturing video with CameraCaptureUI does not work

Boban Pantovic 6 Reputation points
2020-06-30T16:26:08.09+00:00

Hi all,
I have a problem capturing video with CameraCaptureUI, if I already captured a photo.

Try this:
First capture a photo:
private async void Button_CapturePhoto(object sender, RoutedEventArgs e)
{
CameraCaptureUI captureUI = new CameraCaptureUI();
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
captureUI.PhotoSettings.CroppedSizeInPixels = new Size(200, 200);

        StorageFile photo = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);  
    }  

Than capture a video:
private async void Button_CaptureVideo(object sender, RoutedEventArgs e)
{
CameraCaptureUI captureUI = new CameraCaptureUI();
captureUI.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4;

        StorageFile videoFile = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Video);  
    }  

You will get this
11085-image.png

Universal Windows Platform (UWP)
{count} vote