views:

1157

answers:

1

I'm trying to render frames coming from an mkv h264 file in silverlight 3 by using the MediaStreamSource. Parsing the mkv file is fine, but I'm struggling with the expected values for CodecPrivateData in SL, which has to be a string, while the PrivateData info from mkv is a binary element. Also, I'm not sure about in which form the frames should be given to SL (ie, the way they are stored in mkv / mp4, or transcoded as NALU) Would anyone have any info on this?

A: 

Hi,

The CodecPrivateData is the contents of the 'avcC' atom which is a child of the 'stsd' atom in an MP4 file. You have to convert the binary data to a string. It will look something like this: "014D401FFFE10017674D401F925402802DD0800000030080000018478C195001000468EE32C8"

You also have to replace the mkv/mp4 lengths to NALU. I've written a little about this (to get Smooth Streaming to work for H.264 files).

Regards,

hxxp://h264.code-shop.com/trac/wiki/Smooth-Streaming-H264

Arjen