I am using the UWP sample code to live stream the video. It initially works, but eventually an error is thrown in the following code. It seems to be an unhandled exception that I cannot catch and it causes the application to crash.

    private async void OnVideoFrame(VideoFrame frame)
 
    {
 
      if (frame?.Data != null && frame.Data.Length > 0)
 
      {
 
        try
 
        {
 
          var randomAccessStream = await ConvertTo(frame.Data);
 
 
 
          await Core.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
 
          {
 
            var bitmapImage = new BitmapImage();
 
            bitmapImage.SetSource(randomAccessStream);
 
            ImageViewSource = bitmapImage;
 
          });
 
        }
 
        catch (Exception ex)
 
        {
 
          Debug.WriteLine(ex.ToString());
 
        }
 
      }
 
    }

Line 23 throws the following exception after a while:

System.Runtime.InteropServices.SEHException: ‘External component has thrown an exception.’

Hi Arun,

I am not able to reproduce this error. How often do you hit it?

Is there something specific causing it, for how long the video is playing before the exception?

What version of Windows you are using?

After further testing, it seems to be isolated to the x86 mode. Switching to x64, it does not throw that error.

Here’s our version info:

Windows Version 1709 (Os Build 16299.402)

Also our UWP app is targeting the Creator’s update.