tantonj
tantonj

Reputation: 1

UWP MediaCapture.InitializeAsync throws "The specified object or value does not exist 0xC00D36D5" on windows 11 but not 10

I have a UWP application. It initializes a media capture object with an RTSP link (for an axis camera) as the DeviceUri. I set Capture mode to Video only. I correctly set DeviceUriPasswordCredentials (without this I get unauthorized exception, despite the username/password also being in the Uri).

await this.mediaCapture.InitializeAsync(settings);

This line executes without error on any Windows 10 machine, regardless of if I debug from IDE or run from installed Release version.

However, when attempting to run on 2 windows 11 devices (have not, nor can I test on other windows 11 devices). I get the following error:

The specified object or value does not exist 0xC00D36D5

I have no idea what is causing this and been researching it for too long without making any progress. I figure it must be some kind of windows 11 setting.

If I remove the DeviceUri and credentials from the MediaCaptureInitializationSetting the device does connect successfully with the webcam. So it must be some kind of access issue with over the network. It's not anything to do with app capabilities. I've attempted to adjust network sharing settings but that did not seem to help.

The link works fine through VLC streaming. So I know it's not the device's capabilities of accessing the feed. (also without the credentials it gives me an access denied, so obviously it is communicating with the camera)

Any ideas on this would be greatly appreciated.

Below is some sample code which I've modified to remove sensitive data:

try
{
    this.mediaCapture = new MediaCapture();
    MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
    settings.StreamingCaptureMode = StreamingCaptureMode.Video;
    settings.DeviceUri = new Uri("rtsp://fakeuser:fakepassword@192.168.1.100/axis-media/media.amp", UriKind.RelativeOrAbsolute);
    
    string username = "fakeuser";
    string password = "fakepassword";
    settings.DeviceUriPasswordCredential = new Windows.Security.Credentials.PasswordCredential() { 
        UserName = username,
        Password = password
    };
    await this.mediaCapture.InitializeAsync(settings); //Exception occurs here on Windows 11
    this.mediaCapture.Failed += this.MediaCapture_CameraStreamFailed;

    var deviceController = this.mediaCapture.VideoDeviceController;
    this.videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
    this.CamPreview.Source = this.mediaCapture;
    await this.mediaCapture.StartPreviewAsync();
    TimeSpan timerInterval = TimeSpan.FromMilliseconds(66);
    this.frameProcessingTimer = ThreadPoolTimer.CreatePeriodicTimer(ProcessCurrentVideoFrame, timerInterval);
}
catch (System.UnauthorizedAccessException uex)
{
    await new MessageDialog($"{uex.Message}\n{uex.StackTrace}", "Error Connecting Camera").ShowAsync();
}
catch (Exception ex)
{
    await new MessageDialog($"{ex.Message}\n{ex.StackTrace}", "Error Connecting Camera").ShowAsync();
}

Update I've found this post that exactly describes my issue. But there is no solution. https://learn.microsoft.com/en-us/answers/questions/1104454/winrt-rtsp-and-onvif

Upvotes: 0

Views: 109

Answers (0)

Related Questions