mrsatish
mrsatish

Reputation: 429

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.

Upvotes: 6

Views: 3588

Answers (1)

Danijel
Danijel

Reputation: 8600

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?

Upvotes: 3

Related Questions