logo资料库

FLV、F4V格式标准文档.pdf

第1页 / 共48页
第2页 / 共48页
第3页 / 共48页
第4页 / 共48页
第5页 / 共48页
第6页 / 共48页
第7页 / 共48页
第8页 / 共48页
资料共48页,剩余部分请下载后查看
Introduction
The FLV file format
The F4V file format
What’s new in Video File Format 10
Speex
XMP Metadata
The FLV File Format
The FLV header
The FLV file body
FLV tags
Audio tags
AUDIODATA
AACAUDIODATA
Video tags
VIDEODATA
AVCVIDEOPACKET
Data tags
onMetaData
The F4V File Format
The F4V box
ftyp box
moov box
mvhd box
trak box
udta box
meta box
mdia box
minf box
stbl box
tkhd box
mdhd box
stsd box
stsc box
stts box
ctts box
stco and co64 boxes
stss box
stsz box
chpl box
pdin box
mdat box
Required structure
Supported media types
Unsupported boxes
F4V Metadata
Tag box
ilst box
Image metadata
Text metadata
styl box
hlit box
hclr box
krok box
dlay box
drpo box
drpt box
href box
tbox box
blnk box
twrp box
XMP Metadata
uuid box
Video File Format Specification Version 10
Copyright © 2008 Adobe Systems Incorporated. All rights reserved. This manual may not be copied, photocopied, reproduced, translated, or converted to any electronic or machine-readable form in whole or in part without written approval from Adobe Systems Incorporated. Notwithstanding the foregoing, a person obtaining an electronic version of this manual from Adobe may print out one copy of this manual provided that no part of this manual may be printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation, commercial purposes, such as selling copies of this documentation or providing paid-for support services. Trademarks Adobe, ActionScript, Flash, Flash Media Server, XMP, and Flash Player are either registered trademarks or trademarks of Adobe Systems Incorporated and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Adobe Systems Incorporated or other entities and may be registered in certain jurisdictions including internationally. No right or license is granted to any Adobe trademark. Third-Party Information This guide contains links to third-party websites that are not under the control of Adobe Systems Incorporated, and Adobe Systems Incorporated is not responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your own risk. Adobe Systems Incorporated provides these links only as a convenience, and the inclusion of the link does not imply that Adobe Systems Incorporated endorses or accepts any responsibility for the content on those third- party sites. No right, license or interest is granted in any third party technology referenced in this guide. NOTICE: THIS PUBLICATION AND THE INFORMATION HEREIN IS FURNISHED “AS IS”, IS SUBJECT TO CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY KIND (EXPRESS, IMPLIED, OR STATUTORY) WITH RESPECT TO THIS PUBLICATION, AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSES, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. Adobe Systems Incorporated Published November 2008
Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 The FLV file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 The F4V file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 What’s new in Video File Format 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Speex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 XMP Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Chapter 1: The FLV File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 The FLV header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 The FLV file body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 FLV tags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Audio tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 AUDIODATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 AACAUDIODATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Video tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 VIDEODATA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 AVCVIDEOPACKET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 onMetaData. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Chapter 2: The F4V File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 The F4V box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 ftyp box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 moov box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 mvhd box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 trak box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 udta box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 meta box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 mdia box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 minf box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 stbl box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 tkhd box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 mdhd box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 stsd box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 i
stsc box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 stts box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ctts box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 stco and co64 boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 stss box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 stsz box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 chpl box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 pdin box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 mdat box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Required structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Supported media types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Unsupported boxes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Chapter 3: F4V Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 Tag box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 ilst box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Image metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Text metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 styl box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 hlit box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 hclr box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 krok box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 dlay box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 drpo box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 drpt box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 href box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 tbox box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 blnk box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 twrp box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 XMP Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 uuid box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 ii Contents
Introduction This document provides technical format information for the video file formats supported by Adobe® Flash® Player software—FLV and F4V. Adobe seriously considers all feedback to the video file format specification. E-mail any unclear or potentially erroneous information within the specification to Adobe at flashformat@adobe.com. All such email submissions shall be subject to the Submitted Materials guidelines in the Terms of Use at www.adobe.com/misc/copyright.html. The FLV file format Starting with SWF files published for Flash Player 6, Flash Player can exchange audio, video, and data over RTMP connections with the Adobe Flash Media Server™. One way to feed data to Flash Media Server (and thus on to Flash Player clients) is from files in the FLV file format. Starting with SWF files published for Flash Player 7, Flash Player can also play FLV files directly with MIME type video/x-flv. An FLV file encodes synchronized audio and video streams. The audio and video data within FLV files are encoded in the same way as audio and video within SWF files. This document describes FLV version 1. For more information on the FLV format, see Chapter 1, “The FLV File Format,” on page 3. The F4V file format Starting with SWF files published for Flash Player 9 Update 3 (9,0,115,0), Flash Player can play F4V files. The F4V format is based on the format specified by ISO/IEC 14496-12: ISO base media file format. For more information on the F4V format, see Chapter 2, “The F4V File Format,” on page 17. A large part of the F4V format involves metadata. For more information on F4V metadata, see Chapter 3, “F4V Metadata,” on page 35. 1
What’s new in Video File Format 10 The following features are new in the Flash video file format specifications (both FLV and F4V) corresponding to Flash Player 10. Speex Flash Player 10 supports the open source Speex audio codec. Speex data can serve as the audio stream in an FLV file. See “AUDIODATA” on page 6. XMP Metadata The F4V file format supports a box type called 'uuid' which can store data formatted in Adobe’s Extensible Metadata Platform (XMP™) and present it to a SWF file via ActionScript®. See “XMP Metadata” on page 43. 2 Introduction
CHAPTER 1 The FLV File Format 1 Each tag type in an FLV file constitutes a single stream. There can be no more than one audio and one video stream, synchronized together, in an FLV file. An FLV file cannot define multiple independent streams of a single type. Unlike SWF files, FLV files store multibyte integers in big-endian byte order. For example, as a UI16 in SWF file format, the byte sequence that represents the number 300 (0x12C) is 0x2C 0x01; as a UI16 in FLV file format, the byte sequence that represents the number 300 is 0x01 0x2C. Also, FLV files use a 3-byte integer type that is not used in SWF files: a UI24 represents an unsigned 24-bit integer. 3
The FLV header All FLV files begin with the following header: FLV header Field Signature Signature Signature Version TypeFlagsReserved TypeFlagsAudio TypeFlagsReserved TypeFlagsVideo DataOffset Type UI8 UI8 UI8 UI8 UB[5] UB[1] UB[1] UB[1] UI32 Comment Signature byte always 'F' (0x46) Signature byte always 'L' (0x4C) Signature byte always 'V' (0x56) File version (for example, 0x01 for FLV version 1) Must be 0 Audio tags are present Must be 0 Video tags are present Offset in bytes from start of file to start of body (that is, size of header) The DataOffset field usually has a value of 9 for FLV version 1. This field is present to accommodate larger headers in future versions. The FLV file body After the FLV header, the remainder of an FLV file consists of alternating back-pointers and tags. They interleave as shown in the following table: FLV file body Field PreviousTagSize0 Tag1 PreviousTagSize1 Type UI32 FLVTAG UI32 Comment Always 0 First tag Size of previous tag, including its header. For FLV version 1, this value is 11 plus the DataSize of the previous tag. Tag2 ... FLVTAG Second tag 4 The FLV File Format
分享到:
收藏