H.264 video playback (using MediaStreamSource) occurs with 3100 MediaError on WP7 emulator

We are trying to play an H.264 stream with MediaStreamSource on a WP7 emulator. But met with error 3100 from the video:

In the OpenMediaAsync override method of Mp4MediaStreamSource, videoStreamAttribute VideoFourCC is set to "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 simply returned the error "3100 An error occurred", there is no other information. And the same error, even if we set the CodecPrivateData attribute.

+4
source share
1 answer

According to this article, you must install [MediaStreamAttributeKeys.CodecPrivateData]

in the format expected by the codec ([START_CODE] [SPS] [START_CODE] [PPS])

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

Source: https://habr.com/ru/post/1382142/


All Articles