2

I have developed a UWP application that capture video from web cam and saves to local storage of UWP and the application works perfectly fine on local machine however after deploying it on RaspberryPi3 I am getting the fo

The Specified Object or Value Does not Exist

Files are being saved to localData of Application. After debugging I got to know the error is in following lines:

MediaEncodingProfile recordProfile = null;
recordProfile = MediaEncodingProfile.CreateWmv(VideoEncodingQuality.Auto);

await _mediaCapture.StartRecordToStorageFileAsync(recordProfile, recordStorageFile);
_statuses.Add(DateTime.Now.ToString() + ": " + fileName + " Recording in progress");

any help would be appreciated.

Rita Han
  • 9,574
  • 1
  • 11
  • 24
Bilal Amjad
  • 149
  • 3
  • 11

1 Answers1

1

The issue maybe due to your USB camera has no micro phone,  but the default capture mode is video and audio.

So, before calling MediaCapture.InitializeAsync() you need set the StreamingCaptureMode to Video like this:

            var settings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
            settings.StreamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.Audio;
            await mediaCapture.InitializeAsync(settings);
Rita Han
  • 9,574
  • 1
  • 11
  • 24
  • I had similar issue.... setting the streaming capture mode to video worked for me : settings.StreamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.Video; Thanks – ajay saini Jan 20 '17 at 22:43