holzschu / holzschu/a-shell

Include AudioToolbox codec support within internal FFmpeg (or at least its AAC encoder)

Open
#901 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
3.9k
Forks
213
Avg merge
1m
Merged PRs (30d)
1

Description

From the bug reports here, I can see that FFmpeg is among the most used features of a-Shell; I use it near-daily myself. One thing has always disappointed me about it, however: while the internal FFmpeg build includes Apple's rather mediocre VideoToolbox codecs, it does _not_ include support for their audio counterparts.

FFmpeg supports being compiled with Apple's AudioToolbox codecs using the `--enable-audiotoolbox` configure flag (and in fact [also supports it as an output device](https://FFmpeg.org/FFmpeg-all.html#AudioToolbox); I have no idea if that works on iOS though), but it is not enabled within a-Shell's internal build.

That is a shame — unlike their video counterparts, Apple's AudioToolbox codecs, particularly its AAC encoder — are of _excellent_ quality (cf. links below). AudioToolbox also includes a slew of other codecs (e.g. MP3, AC-3, ALAC, FLAC, Opus, …many others), though support for them within FFmpeg varies; the majority are unsupported. They are honestly not why I would like to see AudioToolbox support implemented, however.

The (HE-)AAC encoder is what I (and likely many others) would like to see supported the most. [It is generally considered to be one of the best audio encoders, regardless of codec](https://wiki.hydrogenaud.io/index.php?title=Hydrogenaudio_Listening_Tests), and is even so coveted amongst audio encoding enthusiasts that [a longstanding project exists to hook into the AudioToolbox DLL from iTunes on Windows to create a standalone encoder](https://github.com/nu774/qaac).

Put simply: being able to use Apple's AAC encoder on any iOS device would be fantastic, and it's likely that the capability to do so would drive more people to use a-Shell. Projects like qaac (above) likely would not exist if Apple's AAC encoder were merely _equivalent_ to any other: it really is that much better.

I am aware that FFmpeg includes its own AAC encoder — and that [the FFmpeg developers admit that it is of poor quality](https://trac.ffmpeg.org/wiki/Encode/AAC) ("…currently _the **second** highest-quality AAC encoder available in FFmpeg_…", referring to Fraunhofer's FDK-AAC as first best; however, that page also says "[Apple's encoder is even better than FDK-AAC](https://wiki.hydrogenaud.io/index.php?title=Apple_AAC)").

At the very least, FFmpeg also supports its ALAC and AC-3 encoders, but I am not aware of any comparisons between these and FFmpeg's native implementations. As it is lossless, it is hard to see how ALAC could be any better or worse (perhaps it may be more efficient?), and it's certainly possible that Apple's AC-3 encoder is not as good as FFmpeg's. The same could apply to any other codec AudioToolbox supports (except AAC), but the option to use them couldn't hurt if it were to become available.

Regardless, it's AudioToolbox's AAC encoder that would be most useful (IMO). From a licensing perspective, if VideoToolbox can be used, I don't see why AudioToolbox could not.

As always, thank you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.