H.264 video play (using MediaStreamSource) meet with 3100 MediaError on WP7 emulator

一个人想着一个人 提交于 2019-12-10 15:58:06

问题


We're trying to play a H.264 stream with MediaStreamSource on WP7 emulator. But met with 3100 error with video:

In override method OpenMediaAsync of Mp4MediaStreamSource, videoStreamAttribute VideoFourCC is set as “H264”:

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

But GetSampleAsync was not called at all after OpenMediaAsync, MediaElement just return error “3100 An error has occurred”, no more other information. And same error even if we set CodecPrivateData attribute.


回答1:


According to this article you must set [MediaStreamAttributeKeys.CodecPrivateData]

in the format that codec is expecting ([START_CODE][SPS][START_CODE][PPS])

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


来源:https://stackoverflow.com/questions/8201886/h-264-video-play-using-mediastreamsource-meet-with-3100-mediaerror-on-wp7-emul

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!