Detect MPEG4/H264 I-Frame (IDR) in RTP stream

前端 未结 6 2130
灰色年华
灰色年华 2020-12-04 08:54

I need to detect MPEG4 I-Frame in RTP packet. I know how to remove RTP header and get the MPEG4 frame in it, but I can\'t figure out how to identify the I-Frame.

Doe

6条回答
  •  [愿得一人]
    2020-12-04 09:09

    As far as I know, MPEG4-ES stream fragments in RTP payload usually start with MPEG4 startcode, which can be one of these:

    • 0x000001b0: visual_object_sequence_start_code (probably keyframe)
    • 0x000001b6: vop_start_code (keyframe, if the next two bits are zero)
    • 0x000001b3: group_of_vop_start_code, which contains three bytes and then hopefully a vop_start_code that may or may not belong to a keyframe (see above)
    • 0x00000120: video_object_layer_start_code (probably keyframe)
    • 0x00000100-0x0000011f: video_object_start_code (those look like keyframes as well)
    • something else (probably not a keyframe)

    I'm afraid that you'll need to parse the stream to be sure :-/

提交回复
热议问题