技术贴:解码时AVC1和H264的差别
我一直疑问为什么有些视频解码时显示格式是: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的差别的更多相关文章
- H264/AVC视频解码时AVC1和H264的区别
AVC1与H264的区别 http://blog.csdn.net/qiuchangyong/article/details/6660253 H.264 Video Types The followi ...
- AVC1与H264的差别
今天上网时偶尔发现这个在我脑海里疑惑的问题的答案. H.264 Video Types The following media subtypes are defined for H.264 video ...
- (转)MP4文件两种格式AVC1和H264的区别及利用FFMPEG demux为h264码流事项
出自:http://www.mworkbox.com/wp/work/314.html 2013-05-04 MP4的视频H264封装有2种格式:h264和avc1,对于这个细节,很容易被忽略.笔者也 ...
- 与其争论java和.net的差别,还不如多想点用编程技术挣钱的方式
年前和最近,我发现在博客园和其它地方,有不少争论java和.net哪个好的文章,其实这是种好现象.虽然到了架构层面,技术是通用的,但兼听则明,而且技多不压身,多种挣钱的方式总不会错. 本人最近主攻Ja ...
- 【FFMPEG】各种音视频编解码学习详解 h264 ,mpeg4 ,aac 等所有音视频格式
目录(?)[-] 编解码学习笔记二codec类型 编解码学习笔记三Mpeg系列Mpeg 1和Mpeg 2 编解码学习笔记四Mpeg系列Mpeg 4 编解码学习笔记五Mpeg系列AAC音频 编解码学习笔 ...
- 收藏的技术文章链接(ubuntu,python,android等)
我的收藏 他山之石,可以攻玉 转载请注明出处:https://ahangchen.gitbooks.io/windy-afternoon/content/ 开发过程中收藏在Chrome书签栏里的技术文 ...
- CPU纯软件全虚拟化技术
我们在前面的文章中提到了虚拟化技术的大致分类情况,即分为全虚拟化.半虚拟化和硬件辅助虚拟化3大类.而我们虚拟化技术最主要的虚拟主体就是我们的硬件CPU.内存和IO,那么我们的CPU在全虚拟化模式下如何 ...
- 对于Java培训出身的同学,接下来该怎么学习技术?
首先恭喜从培训班出来找到工作的同学,确实挺不容易的,4个月的培训,每天从早上9点到晚上9点,也是996,主要的活动地方就是宿舍和教室, 让我现在也去培训,我估计还熬不下来. 尤其是对于从小白开始的同学 ...
- 集显也能硬件编码:Intel SDK && 各种音视频编解码学习详解
http://blog.sina.com.cn/s/blog_4155bb1d0100soq9.html INTEL MEDIA SDK是INTEL推出的基于其内建显示核心的编解码技术,我们在播放高清 ...
随机推荐
- 关于css的默认宽度
<div class="boxa"> <div class="boxb">我是div</div> </div> ...
- [原创] ASP.NET WEBAPI 接入微信公众平台 总结,Token验证失败解决办法
首先,请允许我说一句:shit! 因为这个问题不难,但是网上有关 ASP.NET WEBAPI的资料太少.都是PHP等等的. 我也是在看了某位大神的博客后有启发,一点点研究出来的. 来看正题! 1.微 ...
- BZOJ 1316: 树上的询问( 点分治 + 平衡树 )
直接点分治, 用平衡树(set就行了...)维护. -------------------------------------------------------------------------- ...
- BZOJ 1927: [Sdoi2010]星际竞速(最小费用最大流)
拆点,费用流... ----------------------------------------------------------------------------- #include< ...
- Mysql 库、表、字段 字符集
show character set;show create database aloe;show create table book_category;show full columns from ...
- Symfony框架系列----常用命令
一.常用命令 从Entity操作数据库: app/console doctrine:database:create # 创建数据库 app/console doctrine:schema:update ...
- IntelliJ IDEA中创建并运行scala应用程序
1.安装scala插件 2.创建scala项目 下载scala SDK,如果你已经下载了,选择你所下载的版本,点击OK
- Correlation rule tuning
Lots of organizations are deploying SIEM systems either to do their due diligence or because it’s pa ...
- php命名空间及和autoload结合使用问题。
在讨论如何使用命名空间之前,必须了解 PHP 是如何知道要使用哪一个命名空间中的元素的.可以将 PHP 命名空间与文件系统作一个简单的类比.在文件系统中访问一个文件有三种方式: 相对文件名形式如foo ...
- In Action(最短路+01背包)
In Action Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...