【问题标题】:H.264 video play (using MediaStreamSource) meet with 3100 MediaError on WP7 emulatorH.264 视频播放(使用 MediaStreamSource)在 WP7 模拟器上遇到 3100 MediaError
【发布时间】:2011-11-20 13:40:45
【问题描述】:

我们正在尝试在 WP7 模拟器上使用 MediaStreamSource 播放 H.264 流。但遇到视频 3100 错误:

在 Mp4MediaStreamSource 的覆盖方法 OpenMediaAsync 中,videoStreamAttribute VideoFourCC 设置为“H264”:

Dictionary<MediaStreamAttributeKeys, string> videoStreamAttributes = new Dictionary<MediaStreamAttributeKeys, string>();
videoStreamAttributes[MediaStreamAttributeKeys.VideoFourCC] = "H264";
this.videoStreamDescription = new MediaStreamDescription(MediaStreamType.Video, videoStreamAttributes);

但是在 OpenMediaAsync 之后根本没有调用 GetSampleAsync,MediaElement 只是返回错误“3100 An error has occurred”,没有更多其他信息。即使我们设置 CodecPrivateData 属性也会出现同样的错误。

【问题讨论】:

    标签: mediastreamsource


    【解决方案1】:

    根据this的文章你必须设置[MediaStreamAttributeKeys.CodecPrivateData]

    采用编解码器期望的格式 ([START_CODE][SPS][START_CODE][PPS])

    videoStreamAttributes[MediaStreamAttributeKeys.CodecPrivateData] = "000000012742000D96540A0FD8080F162EA00000000128CE060C88";
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-03
      • 2021-12-01
      • 1970-01-01
      • 2015-11-26
      • 1970-01-01
      相关资源
      最近更新 更多