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/118812.html原文链接:https://javaforall.net

(0)
上一篇 2021年11月30日 下午11:00
下一篇 2021年11月30日 下午11:00


相关推荐

  • 如何更好的组织代码「建议收藏」

    如何更好的组织代码「建议收藏」一、组织代码的原因或意义代码的编写应当首先让其他人能够看懂,其次才是让机器能够执行。合理组织代码的目的并不是让计算机理解你的代码,而是让其他人能够很好地读懂你所编写的代码,进而在某种程度上高效而自信

    2022年8月3日
    9
  • 网络入门—家庭组网介绍&基本网络知识

    网络入门—家庭组网介绍&基本网络知识一般情况下家庭级 华为 TPlink 华三 路由器没有光口 只有电口 很多时候路由器 防火墙 无线路由器没有提供光口接入 可以利用并发连接数作为判断硬件的指数 可以理解为一秒钟可以新建多少个 TCP 连接 小线程 光纤不能直接插到路由器上 所以需要有中间转换器 光猫进行光电转换 所以可以利用并发连接数 吞吐率来衡量设备性能 该设备每秒可以处理 转发多少 M G 的流量

    2026年3月18日
    2
  • Windows核心编程第五版pdf

    Windows核心编程第五版pdf下载地址 网盘下载图书简介 编辑这是一本经典的 Windows 核心编程指南 从第 1 版到第 5 版 引领着数十万程序员走入 Windows 开发阵营 培养了大批精英 作为 Windows 开发人员的必备参考 本书是为打算理解 Windows 的 C 和 C 程序员精心设计的 第 5 版全面覆盖 WindowsXP WindowsVista 和 WindowsServe 中的 17

    2026年3月17日
    1
  • Delphi多线程编程

    Delphi多线程编程Delphi 多线程编程 2007 03 1917 411 1 多线程的基本概念 nbsp nbsp nbsp nbsp WIN98 NT 2000 XP 是个多任务操作系统 也就是 一个进程可以划分为多个线程 每个线程轮流占用 CPU 运行时间和资源 或者说 把 CPU 时间划成片 每个片分给不同的线程 这样 每个线程轮流的 挂

    2026年3月17日
    1
  • 《JavaScript 模式》读书笔记(4)— 函数4

    这篇文章我们主要来学习下即时对象初始化、初始化时分支、函数属性-备忘模式以及配置对象。这篇的内容会有点多。六、即时对象初始化保护全局作用域不受污染的另一种方法,即时对象初始化模式。这种模式使用带有

    2022年3月25日
    44

发表回复

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

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