Audio Data Transport Stream (ADTS) is a format, used by MPEG TS or Shoutcast to stream audio, usually AAC.
AAAAAAAA AAAABCCD EEFFFFGH HHIJKLMM MMMMMMMM MMMOOOOO OOOOOOPP (QQQQQQQQ QQQQQQQQ)
Header consists of 7 or 9 bytes (without or with CRC).
LetterLength (bits)DescriptionA12syncword 0xFFF, all bits must be 1B1MPEG Version: 0 for MPEG-4, 1 for MPEG-2C2Layer: always 0D1protection absent, Warning, set to 1 if there is no CRC and 0 if there is CRCE2profile, the MPEG-4 Audio Object Type minus 1F4MPEG-4 Sampling Frequency Index (15 is forbidden)G1private bit, guaranteed never to be used by MPEG, set to 0 when encoding, ignore when decodingH3MPEG-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 decodingJ1home, set to 0 when encoding, ignore when decodingK1copyrighted id bit, the next bit of a centrally registered copyright identifier, set to 0 when encoding, ignore when decodingL1copyright id start, signals that this frame's copyright id bit is the first bit of the copyright id, set to 0 when encoding, ignore when decodingM13frame length, this value must include 7 or 9 bytes of header length: FrameLength = (ProtectionAbsent == 1 ? 7 : 9) + size(AACFrame)O11Buffer fullnessP2Number of AAC frames (RDBs) in ADTS frame minus 1, for maximum compatibility always use 1 AAC frame per ADTS frameQ16CRC if protection absent is 0ADTS packet must be a content of PES packet. Pack AAC data inside ADTS frame, than pack inside PES packet, then mux by TS packetizer.
ADTS frames goes one by one in TCP stream. Look for syncword, parse header and look for next syncword after.
//z 2017-02-08 18:03:05 L.326'21415 BG57IV3 T3795962035.K.F134211643