我一直疑问为什么有些视频解码时显示格式是:H264,大部分又是:AVC1
我在搜索编程资料时在微软的msdn上发现的:
原文:http://msdn.microsoft.com/en-us/library/dd757808(v=vs.85).aspx
FOURCC:AVC1   描述:H.264 bitstream without start codes.
FOURCC:H264   描述:H.264 bitstream with start codes.

H.264 Bitstream with Start Codes

H.264 bitstreams that are transmitted over the air, or contained in MPEG-2 program or transport streams, or recorded on HD-DVD, are formatted as described in Annex B of ITU-T Rec. H.264. According to this specification, the bitstream consists of a sequence of network abstraction layer units (NALUs), each of which is prefixed with a start code equal to 0x000001 or 0x00000001.
这段话的大致意思是:带有开始码的H.264视频一般是用于无线发射、有线广播或者HD-DVD中的。这些数据流的开始都有一个开始码:0x000001 或者 0x00000001.

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 the length of the NALU in bytes. The size of the length field can vary, but is typically 1, 2, or 4 bytes.
这段话的大致意思是:没有开始码的H.264视频主要是存储在MP4格式的文件中的。它的数据流的开始是1、2或者4个字节表示长度数据。

原文中的"NALU"简单说是H.264格式中的最基本的单元,是一个数据包。

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 theBITMAPINFOHEADER 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. IfcbSequenceHeader 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.

H.264的视频类型

以下媒体亚型定义的H.264视频。

亚型fourcc值描述
MEDIASUBTYPE_AVC1“AVC1”H.264比特流没有启动代码。
MEDIASUBTYPE_H264“H264”开始编码的H.264比特流。
MEDIASUBTYPE_h264'H264'的相当于到MEDIASUBTYPE_H264,与不同的fourcc值。
“X264的'MEDIASUBTYPE_X264的相当于到MEDIASUBTYPE_H264,与不同的fourcc值。
“X264”MEDIASUBTYPE_x264相当于到MEDIASUBTYPE_H264,用不同的fourcc值。
这些媒体类型之间的主要区别是存在的比特流中的startcodes。如果亚型是MEDIASUBTYPE_AVC1,thebitstream不包含启动代码。

H.264的码流没有启动代码
MP4容器格式存储H.264没有开始codes.Instead的数据,每个的NALU是由前缀长度字段,从而使字节的NALU thelength。长度字段的大小可以有所不同,butis通常为1,2,或4个字节。

当启动代码是在比特流中不存在,下面的介质类型。

主要类型MEDIATYPE_Video的
亚型MEDIASUBTYPE_AVC1
格式类型FORMAT_MPEG2Video

格式块是MPEG2VIDEOINFO结构。这种结构应填写如下:

HDR:一个VIDEOINFOHEADER2的结构描述的比特流。没有颜色表是存在的BITMAPINFOHEADER结构部分后,biClrUsed必须是零。
dwStartTimeCode:未使用。设置为零。
cbSequenceHeader的在字节dwSequenceHeader数组的长度。
dwProfile:指定H.264的个人资料。
dwLevel:指定H.264水平。
的dwFlags:用于长度字段出现在每次的NALU的字节数。长度字段表示在字节以下的NALU的大小。例如,如果dwFlags是4个,每个的NALU之前由4个字节的长度字段。有效的值是1,2和4。
dwSequenceHeader:一个字节数组可能包含序列参数集(SPS)和图像参数集(PPS)NALUs。
MP4容器可能含有序列参数集(SPS)orpicture参数集(PPS)的文件头或INA单独的流(从视频流中不同)的特殊NAL单元。当isestablished的格式,媒体类型可以指定在dwSequenceHeader阵列SPS和PPS NAL单元。如果cbSequenceHeader大于零,dwSequenceHeaderis含SPS和PPS的NALUs,分隔BY2字节长度字段,所有在网络字节顺序(大端)字节数组开始。它ispossible SPS和PPS,只有这些类型之一,或可以通过审查的NALU本身thenal_unit_type领域确定每个的NALU none.The实际类型。

当使用这种媒体类型,每个媒体样本的NALU的thebeginning开始,NAL单元不跨越样本。这enablesthe解码器来恢复数据损坏或丢弃的样品。

技术贴:解码时AVC1和H264的区别相关推荐

  1. 技术贴:解码时AVC1和H264的差别

    我一直疑问为什么有些视频解码时显示格式是:H264,大部分又是:AVC1 我在搜索编程资料时在微软的msdn上发现的: 原文:http://msdn.microsoft.com/en-us/libra ...

  2. H264/AVC视频解码时AVC1和H264的区别

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

  3. AVC1和H264的区别及利用

    MP4的视频H264封装有2种格式:h264和avc1,对于这个细节,很容易被忽略.笔者也是在改编LIVE555流媒体时,增加mp4文件类型支持时遇到了该问题.(一)首先,从原理上了解一下这2种格式的 ...

  4. MP4文件两种格式AVC1和H264的区别及利用FFMPEG demux为h264码流事项

    原文:http://www.mworkbox.com/wp/work/314.html MP4的视频H264封装有2种格式:h264和avc1,对于这个细节,很容易被忽略.笔者也是在改编LIVE555 ...

  5. (转)MP4文件两种格式AVC1和H264的区别及利用FFMPEG demux为h264码流事项

    出自:http://www.mworkbox.com/wp/work/314.html 2013-05-04 MP4的视频H264封装有2种格式:h264和avc1,对于这个细节,很容易被忽略.笔者也 ...

  6. AVC1与H264的区别

    今天上网时偶尔发现这个在我脑海里疑惑的问题的答案. H.264 Video Types The following media subtypes are defined for H.264 video ...

  7. [转帖]AMOLED的技术和OLED有哪些联系和区别

    AMOLED的技术和OLED有哪些联系和区别 https://display.ofweek.com/2018-06/ART-11000-2300-30243226.html 硬件资料 导读: ?虽然L ...

  8. H.264 x264 h264 AVC1的关系和区别

    H.264是MPEG4的第十部分,是一个标准. 对头,国际上两个视频专家组(VCEG和MPEG)合作提出的标准,两个专家组各有各的叫法,所以既叫H.264,也叫AVC. x264是一个编码器,他参照的 ...

  9. 谈谈CTO、技术总监、首席架构师的区别

    2019独角兽企业重金招聘Python工程师标准>>> 1. 引言 因为,最近经常有朋友拜托我:帮我找一位CTO. 我解释的多了,所以想把这个写下来,看看你们到底需要的是什么样的人? ...

最新文章

  1. Geotools应用简要指南
  2. formal timetable for cambridge
  3. 汇编程序:将字符串中所有大写字符转为小写
  4. 「LG2664 树上游戏」
  5. java 线程分组_Java多线程可以分组,还能这样玩!
  6. es6分享——变量的解构赋值
  7. 图论算法(六)-- 二分图的最大分配问题(JAVA)
  8. c++基础语句(条件判断)
  9. 物流管理系统(SSM+vue+shiro)【前后台】
  10. 【记录】帮同学做的一个函数拟合
  11. 新年跨出第一步:人工智能实施这样做!
  12. python规模大小的指标是_Python 做证券指数三种策略分析 - 最高收益,最大规模,最小风险...
  13. gnome 如何自定义样式_在Gnome 3中自定义字体
  14. XSS 之 haozi me 题解——人生第一份CSDN题解
  15. 电脑只能上qq,但是不能打开网页的…
  16. 微信小程序分享小程序码的生成,多参数以及参数的获取
  17. 工具--Typora详解
  18. Java面试题——基础篇一
  19. Honey Badger BFT(异步共识算法)笔记
  20. 小程序云开发实现微信支付完整代码

热门文章

  1. CentOS7防火墙firewalld开放指定端口
  2. 这一次,我想给你全世界:QQ伤感日志
  3. FFmpeg批量提取视频的某一帧作为封面
  4. redis 3 命令总结
  5. 小米哪款手机将安装鸿蒙系统,小米等“友商”手机可以使用鸿蒙系统吗?华为官方表态给力了!...
  6. 持续集成工具hudson
  7. Linux 设置 jar 包开机自启动
  8. 响应式Spring的道法术器(Spring WebFlux 快速上手 + 全面介绍)
  9. 《秒杀系统架构设计》学习
  10. maven环境变量配置详细步骤(win10)