How to play RTSP live video streaming in UWP app

1

I want to play live video stream RTSP protocol using MediaElement in Universal Windows Platform (UWP) app platform.

I am trying to this way but it now working.

<MediaElement x:Name="mediaPlayer" />

Code Behind

var streamUri = new Uri("rtsp://X.X.X.X:1027/h264/ch1.2");  
var streamResponse = await AdaptiveMediaSource.CreateFromUriAsync(streamUri);
if (streamResponse.Status == AdaptiveMediaSourceCreationStatus.Success)
{
   mediaPlayer.SetMediaStreamSource(streamResponse.MediaSource);
}

Error:

Got Status => streamResponse.Status = ManifestDownloadFailure

Internal Error
base = {System.Runtime.InteropServices.COMException (0xC00D36B2): The request is invalid in the current state. The request is invalid in the current state. at Windows.Media.Streaming.Adaptive.AdaptiveMediaSourceCreationResult.get_MediaSource()}

Is there any third party solution or another way video play in UWP app?

uwp
rtsp
windows-10-universal
mediaelement
asked on Stack Overflow May 27, 2016 by Sender • edited May 27, 2016 by Sender

1 Answer

-1

I used "VLC.MediaElement" for playing RTSP live videos (like camera's streaming).

You can get this control from Nuget: https://www.nuget.org/packages/VLC.MediaElement/

Just set the "Source" of the control and you're set.

https://github.com/kakone/VLC.MediaElement

answered on Stack Overflow Apr 23, 2020 by Fabio La Greca

User contributions licensed under CC BY-SA 3.0