AAC encoder delay

Referencing this document:

https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFAppenG/QTFFAppenG.html


Hi,


I'm looking to determine of there are any existing Apple or third party encoders which use the method 'Track Structures to Represent Encoder Delay Explicitly' for audio priming / handling encoder delay in AAC in a .mov.


Looking at Quicktime 7 (very old I know), Quicktime X and Compressor 4.3.2, they all use the historical solution of encoding a file for the decoder to assume a delay of 2112 samples. So far this is the only method I can see Apple uses in any of their tools despite the description of the track structure (modern) method in their document above.


Does anyone know if there are any Apple or 3rd party encoders which can produce a .mov that strictly follows the modern' method outlined in the above link, known as 'Using Track Structures to Represent Encoder Delay Explicitly'?


Alternativly, can anyone confirm that Quicktime / AVFoundation based decoders will *always* assume 2112 samples of encoder delay no matter the track structure?


Many thanks

Mark

Answered by galad87 in 241434022

The next version of HandBrake will use an explicit encoder delay (you can already download a nightly build or compile the source code yourself).

Right, it doesn't work in QTKit and QuickTime 7. But these are deprecated and 32bit, I guess it's time to switch to AVFoundation now that it's almost feature complete.

Thanks to all those you helped and offered their time to look into this. I feel I've probably hit a bit of a brick wall. The ffmpeg developers don't seem overly concerned with the lack of 'compatibility' with AVFoundation or QTKit based decoders. I'm sure its a complex situation which I don't fully understand, so to be fair to them, they no doubt have their reasons.


I'm not a developer, so I can't be a huge amount of help in offering up a solution. I still think there are some issues which AV Foundation / QT X need to address on their side, but with the right atom structure from ffmpeg I do think it could be much closer to a correct decode.


Thanks
Mark

UPDATE


A very helpful developer has submitted a patch which means ffmpeg (as of 10th Aug 2017) now produces files with the sample group atoms. This is as per Apple's own document.


The good news is that this now means the files play perfectly in sync in AV Foundation based decoders (QT 10.x). The sad news is that QT7 / QT Kit based decoders do not honour this atom and still default to 2112 despite its presence.


I think that makes it clear that the older QT framework never had the ability to work with the sample group atom and obviously now its EOL'ed it will never be fixed. Its a great shame as almost all post production software is still based on the older QT framework, so this issue will hang around for sometime I would imagine.


Anyway, its still a big step forward and I'm enoumously greatful to the developer in question for sorting and submitting the fix.