I am able to open an sdp file in VLC to view a udp livestream from gstreamer. I would like to do the same in WPF. I followed this example: https://github.com/videolan/libvlcsharp/blob/3.x/samples/LibVLCSharp.WPF.Sample/Example2.xaml.cs
But edited the PlayButton_Click
function to take in an sdp file instead (see below).
void PlayButton_Click(object sender, RoutedEventArgs e)
{
if (!VideoView.MediaPlayer.IsPlaying)
{
using (var media = new Media(_libVLC, "sdp://" +
"v=0\n" +
"c=IN IP4 <replace w client IP> \n" +
"m=video 5000 RTP/AVP 96\n" +
"a=rtpmap:96 H265/90000\n" +
"a=fmtp:96 media=video;clock-rate=90000;encoding-name=H265",
FromType.FromLocation))
VideoView.MediaPlayer.Play(media);
}
}
But no video plays when i click the play button. I am certain that the rest of my code is correct because I can play the Big Buck Bunny video by swapping out the sdp string with new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")
.
How do I correctly input the sdp file into LibVLCSharp media?