技术贴:解码时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推出的基于其内建显示核心的编解码技术,我们在播放高清 ...
随机推荐
- objective-C学习笔记(三)数据成员:属性与实例变量
类型成员 Type Member 结构体 struct 的成员很简单,只有变量. 类的成员就很多了: 数据成员 data member 描述对象(本讲重点) · 实例变量 instance vari ...
- Unity UGUI在鼠标位置不同时 图片浮动效果
/// <summary> /// 在鼠标位置不同时 图片浮动效果 /// </summary> public class TiltWindow : MonoBehaviour ...
- HTML5 实现图像模糊算法
做个广告,WEB/PHP/JQ/HTML5/MYSQL/QQ群6848027 项目中需要用到HTML5模糊图像,以前用GDI,GDI+中都有现成的组件来实现,HTML5中如何实现? createIma ...
- bzoj 1042: [HAOI2008]硬币购物 dp+容斥原理
题目链接 1042: [HAOI2008]硬币购物 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 1706 Solved: 985[Submit][ ...
- Linux系统之UpStart
子贡问为仁.子曰:“工欲善其事,必先利其器.居是邦也,事其大夫之贤者,友其士之仁者.”——孔子(春秋)<论语·卫灵公> [工欲善其事,必先利其器] 掌握一门技术,知道其发展历程是非常重要的 ...
- 循环-10. 求序列前N项和(15)
#include<iostream>#include<iomanip>using namespace std;int main(){ double i,n,t,a,b; ...
- [转]IOS 学习笔记(8) 滚动视图(UIScrollView)的使用方法
下面介绍pageControl结合ScrollView实现连续滑动翻页的效果,ScrollView我们在应用开发中经常用到,以g这种翻页效果还是很好看的,如下图所示: 通过这个例子,我们重点学习UIS ...
- 关于JVM的GC机制
GC优点: 1.提高生产率,不用逐行检查内存是否释放. 2.Java安全策略的一部分,不会使用户错误释放内存而导致JVM崩溃. GC算法基本两点: 1.检测出垃圾对象. 2.回收垃圾对象,释放相应堆空 ...
- Oracle Primavera P6 R84单机版安装教程
本教程用于指导Oracle Primavera P6 R84版本的单机版安装过程.P6 R84版本于2014年9月30日发布.其功能较之前版本有较大提升.单机版的安装方式也发生了很大的变化.P6 R8 ...
- delphi 编译生成ipa文件
找IPA文件 开发模式ipa文件和发布模式ipa文件,路径不同. http://www.itnose.net/detail/6101808.html 一.开发模式Development 不需要真机,可 ...