当前位置:网站首页>Detailed explanation of FLV format
Detailed explanation of FLV format
2022-07-06 16:41:00 【Dog egg L】
FLV Format Overview :
FLV(Flash Video) yes Adobe A popular streaming media format designed and developed by the company , Because of its lightweight video file size 、 Simple package and so on , Make it very suitable for application on the Internet . Besides ,FLV have access to Flash Player Play it , and Flash Player Plug ins have been installed in most browsers around the world , This makes it possible to play through the web FLV The video is very easy .
Flv File format
Flv By file header (File Header) and The file body (File Body) form .
Flv Body By a series of Tag form , Every Tag Another one preTagSize Field , Mark the front one Tag Size .
Flv Header
The file header consists of the following parts :
Signature(3 Byte)+Version(1 Byte)+Flags(1 Bypte)+DataOffset(4 Byte)
Signature Occupy 3 Bytes :
Fix FLV Three characters as a symbol . It is generally found that the first three characters are FLV I thought he was flv file .
Version Occupy 1 Bytes :
Mark FLV Version number of . Here we see 1
Flags Occupy 1 Bytes :
Content label . The first 0 Position and number 2 position , respectively video And audio Existing situation .(1 Indicates presence ,0 Does not exist ). notice 0x05, That is to say 00000101, Represents an existing video , There is also audio .
DataOffset Occupy 4 Bytes :
Express FLV Of header length .
The picture below is Flv Header The content of ,(UI8 Indicates no sign 8 position , That's one byte ;UB[5] Represents... In a byte 5 position )
Flv Body
Flv Body One by one Tag form , Every Tag There is one. preTagSize Field , Mark the front one Tag Size .
Tag There are three types ,Audio Tag( Audio Tag),Video Tag( video Tag),script Tag( also called Metadata Tag)
Every Tag from “Tag Header” and “Tag Data” form , For different types of Tag,“Tag Header” The format of is the same ,“Tag Body” The format of is different .
The following figure summarizes the above content , After watching it, right flv There should be an overall understanding .
Generally one flv The file consists of a header message , One script Tag, And several video Tag and audio Tag form .
Let's explain each type of Tag Data
Tag Data
Flv There are three kinds of tag:“Audio Tag Data”、“Video Tag Data”、“Script Tag Data”
Aideo tag By tag Header + Tag Data form :
tag Header:
TagType: 8 (1 byte)
TagType The meaning of the representative is as follows :
8: audio
9 : video
18 : script data
DataSize: 7 (3 bytes)
tag Data size
tag Header size = Previous Tag Size - DataSize
TimeStamp: 0 (3 bytes) Time stamp
TimestampExtended: 0 (1 byte) Extended timestamp
StreamId: 0 (3 bytes) flow ID
Audio Tag Data:
Video tag analysis :
video tag By tag Header + Tag Data form :
tag Header:
TagType: 9 (1 byte)
TagType The meaning of the representative is as follows :
- 8: audio
- 9 : video
- 18 : script data
DataSize: 50 (3 bytes)
tag Data size
tag Header size = Previous Tag Size - DataSize
TimeStamp: 0 (3 bytes) Time stamp
TimestampExtended: 0 (1 byte) Extended timestamp
StreamId: 0 (3 bytes) flow ID
Video Tag Data
scripts tag analysis :
This type of Tag Also commonly known as MetadataTag, Will put some about FLV Metadata information of video and audio, such as :duration、width、height etc. . Usually this type Tag Will follow FileHeader Later as the first Tag appear , And there's only one .
tag Header:
TagType: 18 (1 byte)
TagType The meaning of the representative is as follows :
8: audio
9 : video
18 : script data
DataSize: 293 (3 bytes)
tag Data size
tag Header size = Previous Tag Size - DataSize
TimeStamp: 0 (3 bytes) Time stamp
TimestampExtended: 0 (1 byte) Extended timestamp
StreamId: 0 (3 bytes) flow ID
tag Data:
AMF package : The first byte indicates AMF Packet type
first AMF package :
The first byte is generally 0x02, Representation string , The first 2-3 Bytes represents the length of the string , It's usually 0x000A, Followed by a string , It's usually "onMetaData".
second AMF package :
The first byte is 0x08, Represents an array , The first 2-5 Bytes represent the number of array elements , Followed by the elements of the array , The format is : Element name length (UI16) + Element name (UI8[n]) + The value of the element (double), Finally “009” ending .
边栏推荐
- (lightoj - 1369) answering queries (thinking)
- Simple records of business system migration from Oracle to opengauss database
- 本地可视化工具连接阿里云centOS服务器的redis
- The concept of spark independent cluster worker and executor
- 第7章 __consumer_offsets topic
- Acwing: the 56th weekly match
- 【锟斤拷】的故事:谈谈汉字编码和常用字符集
- Market trend report, technological innovation and market forecast of desktop electric tools in China
- Chapter 5 yarn resource scheduler
- 软通乐学-js求字符串中字符串当中那个字符出现的次数多 -冯浩的博客
猜你喜欢
It is forbidden to trigger onchange in antd upload beforeupload
Hbuilder x format shortcut key settings
antd upload beforeUpload中禁止触发onchange
Browser print margin, default / borderless, full 1 page A4
Codeforces Round #799 (Div. 4)A~H
Discussion on QWidget code setting style sheet
Simple records of business system migration from Oracle to opengauss database
SF smart logistics Campus Technology Challenge (no T4)
第7章 __consumer_offsets topic
Pull branch failed, fatal: 'origin/xxx' is not a commit and a branch 'xxx' cannot be created from it
随机推荐
< li> dot style list style type
Local visualization tools are connected to redis of Alibaba cloud CentOS server
(lightoj - 1354) IP checking (Analog)
Codeforces Round #798 (Div. 2)A~D
Codeforces round 797 (Div. 3) no f
(lightoj - 1323) billiard balls (thinking)
Double specific tyrosine phosphorylation regulated kinase 1A Industry Research Report - market status analysis and development prospect prediction
Li Kou - 298th weekly match
Effet d'utilisation, déclenché lorsque les composants de la fonction sont montés et déchargés
第5章 消费者组详解
Chapter 5 namenode and secondarynamenode
我在字节跳动「修电影」
ByteDance new programmer's growth secret: those glittering treasures mentors
China tetrabutyl urea (TBU) market trend report, technical dynamic innovation and market forecast
CMake Error: Could not create named generator Visual Studio 16 2019解决方法
Useeffect, triggered when function components are mounted and unloaded
Calculate the time difference
Codeforces Round #771 (Div. 2)
解决Intel12代酷睿CPU单线程调度问题(二)
Problem - 1646C. Factorials and Powers of Two - Codeforces