[MPlayer-dev-eng] About H.264 4-byte start code
Jetta
jetta.tang at hhcn.com
Mon Jan 19 07:24:12 CET 2009
Hi,
Sorry that i can not reply in time.
Yes, i have solved this problem in the way adding another 0 in array
"videobuffe".
But just as what you said, my mplayer only can play raw H.264 now,
and can not
decode frame-based video format correctly(it does not work by adding a "0").
Thank you for your suggestions, I will try it.
--
Best regards,
jetta
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.
On Mon, Jan 12, 2009 at 10:17 AM, Jetta <jetta.tang at hhcn.com> wrote:
> Hi all,
> I apologize first if this issue is inappropriate in this maillist.
> I want to use our own new H.264 decoder in MPlayer(in libavcodec), now i
> have a problem.
> Our H264 decoding library assumes that H.264 stream's start code is
> 4-byte 0x00000001, but in Mplayer, it seems to use 3-byte pattern 0x000001
> by calling the function "demux_pattern_3" when read packet. So the input
> date given to H264 decoder will just have 0x000001 start code.
> Can i just write a new function just like "demux_pattern_4" in file
> "demuxer.c" to solve this problem?
> Thanks!
>
> --
> Best regards,
> jetta
>
>
>
>
More information about the MPlayer-dev-eng
mailing list