Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find AAC-LC (non-ADTS) audio packet length

I have AAC-LC audio stream coming directly from audio encoder.

Its a raw stream, No ADTS headers, no container data as I want to stream encoded audio directly as it arrives.(before file gets saved).

I want to determine the frame boundaries/frame lengths/packets lengths in incoming encoded raw AAC stream. (AAC has variable packet lengths.)

Can I search for any fixed frame headers/patterns so that I can determine frame boundaries?

Is it possible with AAC?

Thanks in advance for your valuable inputs.

like image 835
mrsatish Avatar asked Dec 14 '12 11:12

mrsatish


People also ask

What is AAC ADTS?

Audio Data Transport Stream (ADTS) is a container format specified by MPEG-4 Part 3 for audio data, intended to be used for streamed audio, such as for Internet radio. It is, essentially, an almost bare stream of AAC audio data, comprised of ADTS frames with a minimal header. Audio. audio/aac.

Why advanced audio coding AAC standard is preferred?

Advanced Audio Coding (AAC) is an audio coding standard for lossy digital audio compression. Designed to be the successor of the MP3 format, AAC generally achieves higher sound quality than MP3 encoders at the same bit rate.

Is AAC a MP4?

AAC is MPEG-4 Part 3 and MP4 is MPEG-4 Part 14. However, MP4 is the container that stores data; that data is encoded in AAC. The container does not affect the quality of the data and is not an encoding format, so AAC cannot be compared with MP4 in this way. Quality depends on the encoder, not the file type.


1 Answers

If you are taking AAC encoded data directly from encoder then it's up to encoder to send frame by frame. It should not send "packets", but single frames. Otherwise I don't see a way you can parse for frames.

I'd first check if it really sends more than one frame at a time?

If yes, then one solution would be to tell encoder to send ADTS header, then parse info from ADTS, and finally strip down ADTS from the frame and stream it as raw.

Does that help?

like image 191
Danijel Avatar answered Oct 10 '22 09:10

Danijel