[Libav-user] AudioToolbox Encoding - Supporting More Sample Formats

jason at jasonfry.co.uk jason at jasonfry.co.uk
Mon Apr 19 19:15:08 EEST 2021


I'm using libavcodec to encode audio to AAC using the AudioToolbox encoder.

It declares its list of supported pixel formats, but doesn't include AV_SAMPLE_FMT_FLT. See https://github.com/FFmpeg/FFmpeg/blob/7368e5537db61683b535257adbc0c3b15f0f84f2/libavcodec/audiotoolboxenc.c#L633

However when setting up AudioToolbox there is code to handle AV_SAMPLE_FMT_FLT and (AV_SAMPLE_FMT_DBL):
https://github.com/FFmpeg/FFmpeg/blob/7368e5537db61683b535257adbc0c3b15f0f84f2/libavcodec/audiotoolboxenc.c#L242

I've modifed the code locally to simply add AV_SAMPLE_FMT_FLT into `.sample_fmts` and recompiled and it encodes fine, at least with AAC on MacOS Big Sur. 

Looking through the git history for the Audio Toolbox encoder, it doesn't look like .sample_fmts ever contained AV_SAMPLE_FMT_FLT. Is there a known reason they're left out? Is it possible to add in at least AV_SAMPLE_FMT_FLT? What can I do to help get that added in?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210419/98c11016/attachment.htm>


More information about the Libav-user mailing list