AVC1与H264的差别

AVC1与H264的差别

大家好,又见面了,我是全栈君,祝每个程序员都可以多学几门语言。

今天上网时偶尔发现这个在我脑海里疑惑的问题的答案。

H.264 Video Types

The following media subtypes are defined for H.264 video.

Subtype FOURCC Description
MEDIASUBTYPE_AVC1 ‘AVC1’ H.264 bitstream without start codes.
MEDIASUBTYPE_H264 ‘H264’ H.264 bitstream with start codes.
MEDIASUBTYPE_h264 ‘h264’ Equivalent to MEDIASUBTYPE_H264, with a different FOURCC.
MEDIASUBTYPE_X264 ‘X264’ Equivalent to MEDIASUBTYPE_H264, with a different FOURCC.
MEDIASUBTYPE_x264 ‘x264’ Equivalent to MEDIASUBTYPE_H264, with a different FOURCC.

The main difference between these media types is the presence of startcodes in the bitstream. If the subtype is MEDIASUBTYPE_AVC1, thebitstream does not contain start codes.

H.264 Bitstream Without Start Codes

The MP4 container format stores H.264 data without start codes.Instead, each NALU is prefixed by a length field, which gives thelength of the NALU in bytes. The size of the length field can vary, butis typically 1, 2, or 4 bytes.

When start codes are not present in the bitstream, the following media type is used.

Major type MEDIATYPE_Video
Subtype MEDIASUBTYPE_AVC1
Format type FORMAT_MPEG2Video

 

The format block is an MPEG2VIDEOINFO structure. This structure should be filled in as follows:

  • hdr: A VIDEOINFOHEADER2 structure that describes the bitstream. No color table is present after the BITMAPINFOHEADER portion of the structure, and biClrUsed must be zero.
  • dwStartTimeCode: Not used. Set to zero.
  • cbSequenceHeader: The length of the dwSequenceHeader array in bytes.
  • dwProfile: Specifies the H.264 profile.
  • dwLevel: Specifies the H.264 level.
  • dwFlags: The number of bytes used for the length field that appears before each NALU. The length field indicates the size of the following NALU in bytes. For example, if dwFlags is 4, each NALU is preceded by a 4-byte length field. The valid values are 1, 2, and 4.
  • dwSequenceHeader: A byte array that may contain sequence parameter set (SPS) and picture parameter set (PPS) NALUs.

The MP4 container might contain sequence parameter sets (SPS) orpicture parameter sets (PPS) as special NAL units in file headers or ina separate stream (distinct from the video stream). When the format isestablished, the media type can specify SPS and PPS NAL units in the dwSequenceHeader array. If cbSequenceHeader is greater than zero, dwSequenceHeaderis the start of a byte array containing SPS and PPS NALUs, delimited by2-byte length fields, all in network byte order (big-endian). It ispossible to have both SPS and PPS, only one of these types, or none.The actual type of each NALU can be determined by examining thenal_unit_type field of the NALU itself.

When this media type is used, each media sample starts at thebeginning of a NALU, and NAL units do not span samples. This enablesthe decoder to recover from data corruption or dropped samples.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/118605.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 诛仙3 私服架设 仿官网「建议收藏」

    诛仙3 私服架设 仿官网「建议收藏」背景:想情怀一把,抑或想怀旧一下,利用官网的乐趣+私服的金钱,打造一个全新的玩法,这就是我的追求。当然了,好东西是要分享的。 全套工具在百度云盘中: 链接:http://pan.baidu.com/s/1i5HG9YP密码:zg7i…

    2022年9月28日
    4
  • ASP脚本_笛子入门基础教程手指训练

    ASP脚本_笛子入门基础教程手指训练通过前两篇的学习,相信各位已经对ASP的动态网站设计有了一个基本的概念和整体的印象。从本篇开始作者将从脚本语言的使用着手,由浅入深地带领大家探索ASP动态网站设计的真正奥秘。本文第二篇刊登后

    2022年8月1日
    8
  • json_decode用法

    json_decode用法$json='{“a”:1,”b”:2,”c”:3,”d”:4,”e”:5}’;//解析为json对象var_dump(json_decode($json));//解析为数组var_dump(json_decode($json,true));代码执行结果object(stdClass)#1(5){[“a”]=>int(1)[“b”]=>int(2)[“c”]=>int(3)[“d”]=>int(4)

    2022年7月17日
    17
  • quick-cocos2d-x android返回键监听并实现原生退出对话框

    quick-cocos2d-x android返回键监听并实现原生退出对话框

    2021年12月2日
    45
  • Qt HTML CSS颜色对照表

    Qt HTML CSS颜色对照表css颜色代码对照FFFFFF#DDDDDD#AAAAAAFFFFFF#DDDDDD#AAAAAA#888888#666666#444444#000000#FFB7DD#FF88C2#FF44AA#FF0088#C10066#A20055#

    2022年5月17日
    40
  • 提高 Activity 跳转速度

    提高 Activity 跳转速度从一个页面跳转到另外一个页面,这在Android中是很常见的操作;有的页面跳转是瞬间打开,有的是会微微钝一下才打开;或者在页面里弹出一个Dialog弹框,明明已经调用完了show()方法,但弹框没马上弹出来,延迟了一百多毫秒才显示出来,这样给人的体验就很不好了。为什么会出现这种情况呢?页面跳转迟钝和弹框的展示延迟的原因都一样,基本分为两大类。第一类就是看看是否在UI线程左耗时操作,这个经常是数据方面的问题,比如说要从数据库里面查询数据,或者说对数据做了一些复杂逻辑的操作,例如要对集合中的数据,

    2022年5月21日
    33

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号