的xmlns:视频流= “使用:Microsoft.PlayerFramework”
VideoStream:MediaPlayer Source =“http://155.41.145.37/mjpg/video.mjpg”
当我更改Source指向.mp4文件时工作正常。当改为.mjpg时,它将无法工作。运行时显示错误“此视频无法播放”。
请帮忙
Vishnu Aravind答案 0 :(得分:0)
这有效:
Doc:https://channel9.msdn.com/coding4fun/articles/MJPEG-Decoder
下载: http://mjpeg.codeplex.com/
示例代码:
MjpegDecoder _mjpeg;
public MainPage()
{
this.InitializeComponent();
_mjpeg = new MjpegDecoder();
_mjpeg.FrameReady += mjpeg_FrameReady;
_mjpeg.ParseStream(new Uri("http://155.41.145.37/mjpg/video.mjpg"));
}
private async void mjpeg_FrameReady(object sender, FrameReadyEventArgs e)
{
// Convert IBuffer to IRandomAccessStream.
var ras = new InMemoryRandomAccessStream();
await ras.WriteAsync(e.FrameBuffer);
ras.Seek(0);
// Show image.
var bitmap = new BitmapImage();
await bitmap.SetSourceAsync(ras);
image.Source = bitmap;
}