[FFmpeg-user] Apple CoreAudio decoder cuts off first frames of AAC High Efficiency file encoded with ffmpeg

Maximilian Mumme maximilian at algoriddim.com
Tue Jul 4 17:45:43 EEST 2023


Dear ffmpeg-team,

while working with the Apple CoreAudio decoders recently we discovered the following behaviour with AAC High Efficiency-encoded files:

When decoding an AAC HE file encoded with ffmpeg the Apple CoreAudio decoder cuts off a significant number of frames in the beginning of the file. However, when decoding an AAC HE file encoded with e.g. afconvert the CoreAudio decoder can handle this flawlessly.

Here are detailed steps to reproduce this problem:

1. The attached M4A file was generated from a WAV file using the following commands:

# install ffmpeg with AAC support from homebrew
brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-fdk-aac

# encode with AAC High Efficiency codec
ffmpeg -i click_240bpm.wav -vcodec copy -acodec libfdk_aac -profile:a aac_he click_240bpm.m4a

2. The attached “-afconvert” M4A file was generated from the same WAV file using the following command:

afconvert -d aach click_240bpm.wav click_240bpm-afconvert.m4a

I cannot attach the WAV file as it is too big in size. However, the WAV file contains a repeating “high-low-low-low” click pattern where the first “high” click starts exactly at frame 0.

3. Open the two attached files with any app that uses CoreAudio as its backend, e.g. Quick Look (hit space bar in the Finder), QuickTime Player or AULab.

You will hear that for click_240bpm-afconvert.m4a the click pattern is fully audible from the beginning while for click_240bpm.m4a the first “high” click is cut off, making the click pattern start with “low-low-low”.

We were wondering on your opinion on this behaviour: Is that an issue in ffmpeg or would this be on Apple’s side to fix in CoreAudio?

Cheers,
Maximilian




More information about the ffmpeg-user mailing list