Log in

View Full Version : How to identify H264 frame type(I/P) without decoding?


ruian.xu
24th July 2008, 04:52
:helpful:

Hi, Gangs:

Do you know how to identify H264 frame type(I/P)without decoding? I know this is feasible, but I do not have time to learn the standard for the tight schedule.

Can you please kindly explain to me how to do that? Any reference to specific clauses of the standard, or open source decoders for understanding the know-hows would be appreciated.

Thanks a lot!

Guest
24th July 2008, 06:29
Look at FirstPartOfSliceHeader() in the JM reference software.

ruian.xu
24th July 2008, 13:11
Thanks, neuron2! I'll try with some H264 stream.

Guest
24th July 2008, 14:34
I do this at the end of FirstPartOfSliceHeader():

if (currSlice->start_mb_nr == 0)
{
frame_type = img->type;
switch (frame_type)
{
case 0:
sprintf(szBuffer, "P");
break;
case 1:
sprintf(szBuffer, "B");
break;
case 2:
sprintf(szBuffer, "I");
break;
case 3:
sprintf(szBuffer, "SP");
break;
case 4:
sprintf(szBuffer, "SI");
break;
}
}