AAC
常见flv文件封装的音频用的都是aac编码,aac文件有两种格式,一个是ADIF(Audio Data Interchange Format, 音频数据交换格式 ),一个是ADTS(Audio Data Transport Stream, 音频数据传输流)。其中ADIF多用于磁盘存储,仅在文件首部保存解码信息,而ADTS格式用于流式传输,因此每一帧都包含头信息,可以从任一帧开始解码,故用于流式传输。
ADTS
ADTS AAC文件格式如下:
ADTS_header | AAC ES | ADTS_header | AAC ES | ······· |
---|
ADTS header
Field | Type | Commet |
---|---|---|
Syncword | 12 bits | The bit string ‘1111 1111 1111’. |
ID | 1 bit | MPEG identifier, 0 for MPEG-4, 1 for MPEG-2 |
layer | 2 bits | Indicates which layer is used. Set to ‘00’. |
protection_absent | 1 bit | Set to 1 if there is no CRC and 0 if there is CRC |
profile |