`
hgfghw1
  • 浏览: 50090 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

flv文件格式解读之视频tags

阅读更多

视频tags的组成:
//---------------------------------------------------------------------------
tag类型 0x09
tag数据大小 3个字节的视频数据大小
tag时间戳 3个字节tag数据应用的时间(毫秒)
tag时间戳扩展 1个字节的时间戳扩展,让时间戳变成4字节,本字节作为时间戳的高位.
streamID 3个字节的类id,总是0
视频tags的数据
//-----------------------------------------------------------------------------------------------------------
视频tags的数据:
视频tags数据和swf文件格式中的VideoFrame是相似的.他们的数据是一样的
视频格式的数据的组成如下:
帧类型 4bit
1: 关键帧keyframe(视频中的关键帧,数据存储的是整个画面完整的数据,可以提取它来生成图片)
2: 中间帧inter frame(关键帧之间的状态,不完整的画面数据,需要依靠前面帧的数据生成)
3: 可任意使用的中间帧disposable inter frame(H.263 only)
视频编码id 4bit
2: Sorenson H.263(mencoder转换所使用的视频编码)
3: Screen video
4: On2 VP6
5: On2 VP6 with alpha channel
6: Screen video version 2
//---------------
视频数据
If CodecID = 2
H263VIDEOPACKET
If CodecID = 3
SCREENVIDEOPACKET
If CodecID = 4
VP6FLVVIDEOPACKET
If CodecID = 5
VP6FLVALPHAVIDEOPAC
KET
If CodecID = 6
SCREENV2VIDEOPACKET
//--------------------------------------------------------------------------------------------
这里说一下Sorenson H.263视频编码以及其数据包:
从swf6开始,flash使用被称作Sorenson H.263的视频编码格式,这种格式基于h.263,一个公开视频编码标准由ITU(国际电信联盟)
提出的.想了解h.263编码格式的朋友可以看
http://www.chinavideo.org/index.php?option=com_content
&task=view&id=123&Itemid=0
但是Sorenson H.263编码和H.263是有差别的:
下面的特性不存在Sorenson H.263中:
■ GOB (group of blocks) layer
■ Split-screen indicator
■ Document camera indicator
■ Picture freeze release
■ Syntax-based arithmetic coding
■ PB frames
■ Continuous-presence multipoint
■ Overlapped block-motion compensation
下面的特性是Sorenson H.263增加的:
■ Disposable frames (difference frames with no future dependencies)
■ Arbitrary picture width and height up to 65535 pixels
■ Unrestricted motion vector support is always on
■ A deblocking flag is available to suggest the use of a deblocking filter
//---------------------------------------------------------------------------------
H263VIDEOPACKET数据结构:
PictureStartCode UB[17]  和H.263 5.1.1相似
    0000 0000 0000 0000 1
Version  UB[5]  视频格式版本
    Flash Player 6 supports 0 and 1
TemporalReference UB[8]  察看 H.263 5.1.2
PictureSize UB[3]  图像尺寸:
    000: custom, 1 byte
    001: custom, 2 bytes
    010: CIF (352x288)
    011: QCIF (176x144)
    100: SQCIF (128x96)
    101: 320x240
    110: 160x120
    111: 保留
CustomWidth   If PictureSize = 000 UB[8]
    If PictureSize = 001 UB[16]
    否则不存在
    注意:UB[16]不一样UI16,这里不是字节交换的
    单位是像素
CustomHeight   If PictureSize = 000 UB[8]
If PictureSize = 001 UB[16]
    否则不存在 
    注意:UB[16]不一样UI16,这里不是字节交换的
    单位是像素
PictureType UB[2]   00: intra frame
    01: inter frame
    10: disposable inter frame
    11: reserved
DeblockingFlag UB[1]  Requests use of deblocking
    filter (advisory only, Flash
    Player may ignore)
Quantizer UB[5]   See H.263 5.1.4
ExtraInformationFlag UB[1]  See H.263 5.1.9
ExtraInformation   If ExtraInformationFlag = 1
    UB[8]
    Otherwise absent
    See H.263 5.1.10
    The ExtraInformationFlag-
    ExtraInformation sequence
    repeats until an
本文转自:http://www.5uflash.com/flashjiaocheng/Fmsjiaocheng/2350.html
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics