muraliv
muraliv

Reputation: 175

Some Queries on HLS Independent Segments and AAC codec?

According to Apple HLS spec, #EXT-X-INDEPENDENT-SEGMENTS tag indicates that the segments are independent and can be decoded indepedently of each other. This tag can be specified either in master playlist or rendition playlist or both.

I assume that this applies for both video and audio decoding? If so, if I used MediaConvert or ffmpeg to prepare a HLS stream with AAC-LC codec, then audio for each HLS segements can be decoded independently? I read somewhere that AAC requires 2 packets/frames for decoding due to its overlapping encoding logic. Then, will the first audio packet for the next HLS segment depend on the last audio packet of the previous HLS segment for decoding, or is it still the case that the audio packets can be decoded independently across HLS segments?

Upvotes: 1

Views: 919

Answers (1)

Markus Schumann
Markus Schumann

Reputation: 8244

AAC-LC doesn't have the concept of an I-Frame like mechanism. So there isn't anything special you can do to AAC-LC audio at #EXT-X-INDEPENDENT-SEGMENTS points. For the best reproduction you would have to prime the AAC-LC decoder with the previous frame.

If you don't prime the decoder the first packet will have minor quality issues. An AAC packet is 1024 samples which is 1024 / 48.000 kHz = 21.3 ms. So for about 0.02 seconds the quality is slightly diminished. I don't consider this a big issue.

xHE-AAC (newer AAC flavor) has the independent segment feature.

Upvotes: 0

Related Questions