Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8741899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:24:04+00:00 2026-06-13T11:24:04+00:00

I’m writing a Flash video player to play Apple HLS video streams and I’m

  • 0

I’m writing a Flash video player to play Apple HLS video streams and I’m finding that any content with an AAC audio track which has been segmented by the Apple tools with the -optimize option enabled (Now the default) has an audio track which I can not decode (The sync bytes aren’t where I think they should be).

What does the optimize option do to the audio? Is it re-encoding it or just packing it differently?

Most importantly, what do I need to do in order to read the audio track correctly?

I’ve been searching for some months now, but no one seems to have a technically useful answer to this (i.e. anything beyond “It makes the files smaller”).

This appears to only affect the audio track, if I disable audio decoding, the video plays back just fine in all cases, at least all I’ve seen so far – Apple tools, ffmpeg, commercial encoders etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:24:05+00:00Added an answer on June 13, 2026 at 11:24 am

    Ok, so after some experimenting I think I’ve found the answer to my question.

    Normally AAC frames are packed such that a (small) whole number of AAC frames fit within a single Payload Unit, roughly interleaved in PTS order with the video frames they synchronize with. These Payload Units are then packed into the payload space of consecutive 188 byte TS Packets, with the empty space in the last TS Packet padded with junk (i.e. not part of the data stream). This can mean that in a 10 second TS segment you might have an overhead in the order of roughly 2-6 Kbytes.

    With AAC optimization, two things appear to change.

    1. The size of the Payload Units containing the AAC frames is increased, reducing overall the number of Payload Units.
    2. The Payload Units are sized to an exact multiple of the payload space in a TS Packet rather than to fit an number of whole AAC frames.

    This means that padding is all but eliminated – All used space is valuable data so the overall size is reduced.

    In addition, this means that AAC frames are no longer immediately adjacent to the video frames they should sync with – They may be some considerable distance apart in fact.

    This also means, however, that an individual Payload Unit may not be able to fit a whole AAC frame at the end, so as much of the frame as will fit is put in this Payload Unit, and the rest is put at the beginning of the next AAC Payload Unit – This means that AAC Payload Units may not start with AAC frame sync bytes! (Which is what I was seeing!)

    Wherever either the read AAC frame is not long enough to contain a whole header, or where the AAC payload length in the AAC header is less than remaining Payload Unit length, then the remaining data must be in the next AAC Payload Unit – Note however, this may be in the next segment!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.