1

xmlns:VideoStream="使用:Microsoft.PlayerFramework"

VideoStream:MediaPlayer Source="http://155.41.145.37/mjpg/video.mjpg"

当我更改指向 .mp4 文件的源时工作正常。当更改为 .mjpg 时,它将不起作用。运行时显示错误“此视频无法播放”。

请帮忙

毗湿奴阿拉文德

4

1 回答 1

0

这有效:

文档: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;
}
于 2016-03-24T12:45:09.753 回答