【发布时间】:2014-11-19 00:00:01
【问题描述】:
我们一直在为原始 H.264 和 AAC 内容开发流式传输应用程序。我们正在使用 MediaStreamSource 向 MediaElement 提供样本,并且当我们使用 PC SilverLight(在 IE9 上)进行音频/视频播放时没有观察到任何问题。仅音频流在 WP7 上也可以正常工作。但是,我们在 WP7 上播放视频时面临以下问题:
•在没有 CodecPrivateData 的情况下初始化 MediaStreamSource 的视频流属性时,将调用 MediaElement "Failed" 事件处理程序,错误代码为 3100。视频流属性初始化为:
Dictionary<MediaStreamAttributeKeys, string> videoStreamAttributes = new Dictionary<MediaStreamAttributeKeys, string>();
videoStreamAttributes[MediaStreamAttributeKeys.VideoFourCC] = "H264";
this.videoStreamDescription = new MediaStreamDescription(MediaStreamType.Video, videoStreamAttributes);
•当使用 CodecPrivateData ([start code] [sps] [startcode] [pps]) 初始化 MediaStreamSource 的视频流属性时,视频播放但似乎以更快的速度播放 - 是指定 FPS 的 2 到 3 倍. Video Stream 属性初始化为:
Dictionary<MediaStreamAttributeKeys, string> videoStreamAttributes = new Dictionary<MediaStreamAttributeKeys, string>();
videoStreamAttributes[MediaStreamAttributeKeys.VideoFourCC] = "H264";
videoStreamAttributes[MediaStreamAttributeKeys.CodecPrivateData] = "000000012742000D96540A0FD8080F162EA00000000128CE060C88";
this.videoStreamDescription = new MediaStreamDescription(MediaStreamType.Video, videoStreamAttributes);
请注意,无论有无 CodecPrivateData,相同的流在 PC SilverLight 上都可以正常播放,包括音频和视频。 初始化视频流属性有问题吗?什么可能导致此问题,我们该如何解决?
问候, NKS。
【问题讨论】:
标签: windows-phone-7