https://github.com/332065255/flv2fmp4
代码库
软编码Flv 到Mp4 容器(一)
软编码Flv 到Mp4 容器(二) flv tag拆解
软编码Flv 到Mp4 容器(三) flv metadata tag解析
软编码Flv 到Mp4 容器(四) fmp4 总览和基础讲解
软编码Flv 到Mp4 容器(五) fmp4 ftyp box 和moov>mvhd box详解
软编码Flv 到Mp4 容器(六) fmp4 moov>trak>tkhd box 和 moov>trak>mdia>mdhd box讲解
软编码Flv 到Mp4 容器(七) fmp4 mdia>hdlr box 和 mdia>minf> smhd 和dinf box讲解
软编码Flv 到Mp4 容器(八) fmp4 mdia>stbl>stsd box 讲解
软编码Flv 到Mp4 容器(九) fmp4 stts stsc stsz stco box 讲解
软编码Flv 到Mp4 容器(十) fmp4 mvex box 讲解
软编码Flv 到Mp4 容器(十一) fmp4 moof box详解
软编码Flv 到Mp4 容器(十二) fmp4 mdat box详解
软编码Flv 到Mp4 容器(十三) fmp4 生成ftyp和moov所必要的 flv数据
- ftyp
- moov
- mvhd
- trak
- tkhd
- mdia
- mdhd
- hdlr
- minf
- smhd
- dinf
- dref
- url
- stbl
- stsd
- mp4a(avc1)
- esds(avcC)
- stts
- stsc
- stsz
- stco
- mvex
-trex
- moof
- mfhd
- traf
-tfhd
-tfdt
-sdtp
-trun
- mdat
首先对应标题的box在 fmp4容器中的位置
这一章非常复杂,代码量很大
stbl box
Box Type: ‘stbl’
Container: Media Information Box (‘minf’)
Mandatory: Yes
Quantity: Exactly one
定义
aligned(8) class SampleTableBox extends Box(‘stbl’) {
}
stbl是一个容器box
stsd box
BoxTypes: ‘stsd’
Container: Sample Table Box (‘stbl’)
Mandatory: Yes
Quantity: Exactly one
定义
aligned(8) abstract class SampleEntry (unsigned int(32) format) extends Box(format){
const unsigned int(8)[6] reserved = 0;
unsigned int(16) data_reference_index;
}
class HintSampleEntry() extends SampleEntry (