H.264比特流中的帧计数 [英] Count frames in H.264 bitstream

查看:149
本文介绍了H.264比特流中的帧计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算/检测原始H.264比特流中的帧(图片)?我知道有5种VCL NALU类型,但我不知道如何将它们的序列识别为访问单元.我想检测帧意味着将访问单元检测为访问单元

How to count/detect frames (pictures) in raw H.264 bitstream? I know there are 5 VCL NALU types but I don't know how to rec(k)ognize sequence of them as access unit. I suppose detect a frame means detect an access unit as access unit is

一组NAL单元,它们在解码顺序上是连续的,并且包含 一张主编码图片.除了主要编码 图片,访问单元也可能包含一个或多个冗余编码 图片,一张辅助编码图片或其他NAL单元 包含已编码图片的切片或切片数据分区.这 访问单元的解码始终会产生解码的图片.

A set of NAL units that are consecutive in decoding order and contain exactly one primary coded picture. In addition to the primary coded picture, an access unit may also contain one or more redundant coded pictures, one auxiliary coded picture, or other NAL units not containing slices or slice data partitions of a coded picture. The decoding of an access unit always results in a decoded picture.

我希望它知道什么是直播流到服务器的FPS.

I want it to know what is the FPS of live stream out to server.

推荐答案

摘自ITU-T H.264(03/2009):

7.4.1.2.3 NAL单元和编码图片的顺序以及与访问单元的关联

此子节规定了NAL单元和编码图片的顺序以及与编码视频序列的访问单元的关联,这些编码视频序列符合附件A中指定的一个或多个配置文件,并使用第2-9条中指定的解码过程对其进行了解码.

This subclause specifies the order of NAL units and coded pictures and association to access unit for coded video sequences that conform to one or more of the profiles specified in Annex A that are decoded using the decoding process specified in clauses 2-9.

访问单元由一个主编码图像,零个或多个相应的冗余编码图像以及零个或多个非VCL NAL单元组成. VCL NAL单元与主要或冗余编码图片的关联在第7.4.1.2.5节中进行了描述.

An access unit consists of one primary coded picture, zero or more corresponding redundant coded pictures, and zero or more non-VCL NAL units. The association of VCL NAL units to primary or redundant coded pictures is described in subclause 7.4.1.2.5.

比特流中的第一个访问单元从比特流的第一个NAL单元开始.

The first access unit in the bitstream starts with the first NAL unit of the bitstream.

主编码图片的最后一个VCL NAL单元之后的以下任何NAL单元中的第一个,指定新访问单元的开始:

The first of any of the following NAL units after the last VCL NAL unit of a primary coded picture specifies the start of a new access unit:

  • 访问单元定界符NAL单元(如果有)
  • 序列参数集NAL单位(如果存在),
  • 图片参数集NAL单位(如果有)
  • SEI NAL单位(如果有)
  • nal_unit_type在14到18之间(包括端点)的NAL单位,
  • 主要编码图片的第一个VCL NAL单元(始终存在).

在第7.4.1.2.4节中规定了检测主编码图像的第一个VCL NAL单元的约束条件.

The constraints for the detection of the first VCL NAL unit of a primary coded picture are specified in subclause 7.4.1.2.4.

7.4.1.2.4检测主编码图片的第一个VCL NAL单元

此子节规定了对VCL NAL单元语法的约束,这些约束足以使每个主编码图片的第一个VCL NAL单元的检测符合与附件A中指定的一个或多个已解码配置文件相符的编码视频序列使用第2-9条中指定的解码过程.

This subclause specifies constraints on VCL NAL unit syntax that are sufficient to enable the detection of the first VCL NAL unit of each primary coded picture for coded video sequences that conform to one or more of the profiles specified in Annex A that are decoded using the decoding process specified in clauses 2-9.

任何编码切片NAL单元或编码切片数据分区当前访问单元的主编码图片的NAL单元应与任何编码切片NAL单元或编码切片数据分区A的主编码图片的NAL单元不同.下列一种或多种方式访问​​上一个访问单元:

Any coded slice NAL unit or coded slice data partition A NAL unit of the primary coded picture of the current access unit shall be different from any coded slice NAL unit or coded slice data partition A NAL unit of the primary coded picture of the previous access unit in one or more of the following ways:

  • frame_num的值不同.用于测试此条件的frame_num的值是出现在切片标头语法中的frame_num的值,而不管是否由于存在memory_management_control_operation而将该值推断为等于0以供以后在解码过程中使用等于5.(注1 –以上声明的结果是,frame_num等于1的主编码图片不能包含等于5的memory_management_control_operation,除非满足其后的下一个主编码图片满足以下列出的某些其他条件(如果有).)
  • pic_parameter_set_id的值不同.
  • field_pic_flag的值不同.
  • bottom_field_flag都存在并且值不同.
  • nal_ref_idc的值不同,其中nal_ref_idc值之一等于0.
  • pic_order_cnt_type都等于0,并且pic_order_cnt_lsb的值不同,或者delta_pic_order_cnt_bottom的值不同.
  • pic_order_cnt_type都等于1,并且delta_pic_order_cnt [0]的值不同,或者delta_pic_order_cnt [1]的值不同.
  • IdrPicFlag的值不同.
  • IdrPicFlag都等于1,并且idr_pic_id的值不同.

(注2 –冗余编码图片中的某些VCL NAL单元或某些非VCL NAL单元(例如,访问单元定界NAL单元)也可用于检测访问单元之间的边界,并且因此有助于检测新的主编码图片的开头.)

(NOTE 2 – Some of the VCL NAL units in redundant coded pictures or some non-VCL NAL units (e.g., an access unit delimiter NAL unit) may also be used for the detection of the boundary between access units, and may therefore aid in the detection of the start of a new primary coded picture.)

这篇关于H.264比特流中的帧计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆