Codec private data for mpeg4 decoder RRS feed

  • Question

  • Hi 

    I have been working on a live streaming application. At the moment i have been struggling to decode mpeg4 frame from a IP Camera. However, reading the forum i came across a post which highlights that the codec private data needs to be set for the decoder, yet there is no information in regards to this available on the media foundation pages in regards to the private data structure/format.

    I would be very grateful if some one can shed some light on the issue or point me in the right direction.


    Note: For the purpose of the streaming i have created a custom media source and custom media stream.

    Tuesday, October 8, 2013 5:59 PM

All replies

  • Codec private data is not something that can be generated by a player. The data is specific to that encoding of the stream, and is provided by the encoder at the time the content is encoded.  For an ASF file with codec private data, this would be included as the extra data after the VIDEOINFOHEADER.  That block of data would be set as the value of the MF_MT_USER_DATA attribute.

    If your IP camera is outputting an MPEG4 container with H264 video encoding (much more common), then the issue is probably around converting the H264 bitstream to an Annex B stream with start codes.  The SPS (sequence parameter set) and PPS (picture parameter set) from the MPEG4 file header also need to be prepended to the bitstream.

    Thursday, October 10, 2013 9:29 PM