Saturday, 4 June 2011

More tips on using a MediaStreamSource with H264 video

I've recently blogged a little about parsing H264/AAC video and audio streams and passsing the individual samples to Silverlight's native decoder. (using MediaStreamSource class)

Here are some more observations:
  • Silverlight expects frames in Dts (decoding) order, not presentation order.
  • If using HE-AAC audio, you must set the number of channels to 1. Two or more channels are not suported; thanks to anonymous commenter for this information.
  • Access unit delimiters seem to be optional; they are stripped out by the decoder. I send them anyway, but it doesn't seem to make a difference.
  • Your stream will probably contain 'Emulation prevention three byte' codes. I don't think you need to strip these out; it seems to make no difference if you pass them to the Silverlight decoder; my guess is that it searches for, and strips out the codes.

You can see the parsing working successfully in SilverLive, my HTTP Live Streaming client for Silverlight.

0 comments:

Post a Comment