ADTS结构介绍

Audio Data Transport Stream (ADTS) is a format, used by MPEG TS or Shoutcast to stream audio, usually AAC.

[ edit]

Structure

AAAAAAAA AAAABCCD EEFFFFGH HHIJKLMM MMMMMMMM MMMOOOOO OOOOOOPP (QQQQQQQQ QQQQQQQQ)

Header consists of 7 or 9 bytes (without or with CRC).

LetterLength (bits)Description
A12syncword 0xFFF, all bits must be 1
B1MPEG Version: 0 for MPEG-4, 1 for MPEG-2
C2Layer: always 0
D1protection absent, Warning, set to 1 if there is no CRC and 0 if there is CRC
E2profile, the MPEG-4 Audio Object Type minus 1
F4MPEG-4 Sampling Frequency Index (15 is forbidden)
G1private stream, set to 0 when encoding, ignore when decoding
H3MPEG-4 Channel Configuration (in the case of 0, the channel configuration is sent via an inband PCE)
I1originality, set to 0 when encoding, ignore when decoding
J1home, set to 0 when encoding, ignore when decoding
K1copyrighted stream, set to 0 when encoding, ignore when decoding
L1copyright start, set to 0 when encoding, ignore when decoding
M13frame length, this value must include 7 or 9 bytes of header length: FrameLength = (ProtectionAbsent == 1 ? 7 : 9) + size(AACFrame)
O11Buffer fullness
P2Number of AAC frames (RDBs) in ADTS frame minus 1, for maximum compatibility always use 1 AAC frame per ADTS frame
Q16CRC if protection absent is 0
[ edit]

E profile 表示使用哪个级别的AAC,如01 Low Complexity(LC)--- AACLC

F sampling_frequency_index 表示使用的采样率下标

sampling_frequency_index sampling          frequeny [Hz]

0x0                                                                       96000

0x1                                                                       88200

0x2                                                                       64000

0x3                                                                       48000

0x4                                                                       44100

0x5                                                                       32000

0x6                                                                       24000

0x7                                                                       22050

0x8                                                                      16000

0x9                                                                       2000

0xa                                                                      11025

0xb                                                                        8000

0xc                                                                    reserved

0xd                                                                    reserved

0xe                                                                    reserved

0xf                                                                     reserved

H channel_configuration 表示声道数

M frame_length 一个ADTS帧的长度,包括ADTS头和raw data block.

O adts_buffer_fullness  0x7FF 说明是码率可变的码流

P number_of_raw_data_blocks_in_frame 表示ADTS帧中有number_of_raw_data_blocks_in_frame + 1个AAC原始帧.

所以说number_of_raw_data_blocks_in_frame == 0 表示说ADTS帧中有一个AAC数据块并不是说没有。(一个AAC原始帧包含一段时间内1024个采样及相关数据)


Usage in MPEG-TS

ADTS packet must be a content of PES packet. Pack AAC data inside ADTS frame, than pack inside PES packet, then mux by TS packetizer.

[ edit]

Usage in Shoutcast

ADTS frames goes one by one in TCP stream. Look for syncword, parse header and look for next syncword after.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值