[vlc-devel] Smooth Streaming, MP4 and H.264

Christopher Mueller christopher.mueller at itec.uni-klu.ac.at
Mon Oct 10 17:37:38 CEST 2011

> Hello all,
> As discussed in a previous thread [1], I try to do a VLC module that
> would add support for a subset of MS Smooth Streaming protocol.
> Contrary to DASH, a initialization segment (i.e. ftyp + moov boxes for
> MP4) isn't provided, thus MP4 demuxer and H.264 decoder must be
> initialized with data provided in the manifest (a SS manifest is like
> a DASH MPD or a HLS playlist, exemple in [2]).
> I thought the most straightforward way to work around that was to
> build a moov box from the manifest, so I wrote a python script [3] to
> see if such a solution could work.
> The script can produce a valid moov box for one of the video quality
> levels available, but I didn't succeed to produce a moov box such that
> switching among the different quality levels would be possible.
> Actually I don't know if this is my avcC box which is not correctly
> generated, or something else, like a limitation of libavformat...
> FYI, here is the definition of the AVCDecoderConfigurationRecord,
> which is the "payload" of the avcC box:
> aligned(8) class AVCDecoderConfigurationRecord {
>   unsigned int(8) configurationVersion = 1;
>   unsigned int(8) AVCProfileIndication;
>   unsigned int(8) profile_compatibility;
>   unsigned int(8) AVCLevelIndication;
>   bit(6) reserved = ‘111111’b;
>   unsigned int(2) lengthSizeMinusOne;
>   bit(3) reserved = ‘111’b;
>   unsigned int(5) numOfSequenceParameterSets;
>   for (i=0; i< numOfSequenceParameterSets; i++) {
>     unsigned int(16) sequenceParameterSetLength ;
>     bit(8*sequenceParameterSetLength) sequenceParameterSetNALUnit;
>   }
>   unsigned int(8) numOfPictureParameterSets;
>   for (i=0; i< numOfPictureParameterSets; i++) {
>     unsigned int(16) pictureParameterSetLength;
>     bit(8*pictureParameterSetLength) pictureParameterSetNALUnit;
>   }
> }

If your avcC box looks like that than it should be correct because this is
the definition from ISO/IEC 14496-15:2010 (MPEG-4 Part 15). Take
care of the lengtsize because samples in MP4 are length encoded and not in
annexb nalu format.

> From the manifest provided in [2], the script build an
> AVCDecoderConfigurationRecord which contains 8 SequenceParameterSets,
> each of which having a
> sequenceParameterSetNALUnit taken from the CodecPrivateData attribute
> of the manifest file. Unfortunately it is not sufficient to properly
> initialize the H.264 decoder :-(

I hope you have also produced a picture parameter set? If you do not
switch between different resolutions than this should be correct. Because
the decoder would only see a stream with variable bitrate.


More information about the vlc-devel mailing list