[MPlayer-dev-eng] About H.264 4-byte start code

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Jan 12 18:29:42 CET 2009


On Mon, Jan 12, 2009 at 05:07:25PM +0000, Loren Merritt wrote:
> On Mon, 12 Jan 2009, Reimar Döffinger wrote:
>
>> On Mon, Jan 12, 2009 at 12:19:15PM +0100, Nico Sabbi wrote:
>>> are you sure?
>>> I remember that some time ago you explained me that the 4 leading 0s
>>> were actually the right format to use
>>
>> For files according to annex B (AFAIK only raw and MPEG container) yes,
>> but not in general. I also think that I didn't do the explaining, but
>> that it was actually explained to me...
>
> Annex B is the only part of the standard that mentions startcodes, so what 
> else would you be using?

Not quite, 6.1 does mention it too and I read it too quickly...
So since I obviously was wrong, I have to look again why then I did not
implement demux_pattern_4...
And the answer is simple: because it is pointless currently, if it is
necessary you can brute-force fix the H.264 case by changing in
parse_es.c:
  // COPY STARTCODE:
  packet_start=videobuf_len;
  videobuffer[videobuf_len+0]=0;
  videobuffer[videobuf_len+1]=0;
  videobuffer[videobuf_len+2]=1;
  videobuffer[videobuf_len+3]=next_nal;
  videobuf_len+=4;

to add another 0 there.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list