当前位置:网站首页>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 .
边栏推荐
- js封装数组反转的方法--冯浩的博客
- useEffect,函数组件挂载和卸载时触发
- Chapter 5 yarn resource scheduler
- Gridhome, a static site generator that novices must know
- 视频压缩编码和音频压缩编码基本原理
- Chapter 5 detailed explanation of consumer groups
- 875. Leetcode, a banana lover
- Research Report on hearing health care equipment industry - market status analysis and development prospect prediction
- 计算时间差
- Codeforces Round #771 (Div. 2)
猜你喜欢
第7章 __consumer_offsets topic
Spark独立集群Worker和Executor的概念
第2章 HFDS的Shell操作
JS encapsulates the method of array inversion -- Feng Hao's blog
第五章 Yarn资源调度器
图像处理一百题(11-20)
Install Jupiter notebook under Anaconda
第6章 Rebalance详解
Story of [Kun Jintong]: talk about Chinese character coding and common character sets
Log statistics (double pointer)
随机推荐
Codeforces - 1526C1&&C2 - Potions
AcWing——第55场周赛
Li Kou - 298th weekly match
图像处理一百题(1-10)
Story of [Kun Jintong]: talk about Chinese character coding and common character sets
China tetrabutyl urea (TBU) market trend report, technical dynamic innovation and market forecast
China double brightening film (dbef) market trend report, technical dynamic innovation and market forecast
Chapter III principles of MapReduce framework
Specify the format time, and fill in zero before the month and days
Remove the border when input is focused
Codeforces round 797 (Div. 3) no f
Chapter 6 datanode
生成随机密码/验证码
Codeforces Round #798 (Div. 2)A~D
JS time function Daquan detailed explanation ----- AHAO blog
第6章 DataNode
Acwing - game 55 of the week
Simply try the new amp model of deepfacelab (deepfake)
浏览器打印边距,默认/无边距,占满1页A4
Tert butyl hydroquinone (TBHQ) Industry Research Report - market status analysis and development prospect forecast