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.
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.
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.
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.
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With