by swatcoder · 4y ago · 0 comments
If I had to speculate why Apple wouldn't bundle a unencumbered and popular codec, my first guess would be concerns over power efficiency. But I don't know codecs, and your comment reads like you have more specific insight.
(Notably, Opus can not be used in HLS streams, or in video files. No other browsers support CAF, so you either need to re-mux on the fly or store two copies. It defeats a significant benefit of having a single codec, because Apple won’t support Opus in MKV or OGG. Remuxing is also not all that simple, since this is a proprietary format. Even if your ffmpeg command appears to have worked, that does not mean it will play on an Apple device.)
Power efficiency is possibly an explanation, but it's difficult to really treat that as a charitable argument anymore. As far as I know, they don't have arbitrary limitations that require audio decoding to be hardware accelerated, and both iOS and macOS devices will happily fallback to software decoding whenever it's needed. That's actually fine, since even Opus decoding with an optimized decoder is not really computationally expensive at all. It could run at a very low frequency using only one processor core and still decode realtime. Given that streaming audio over HTTP probably isn't fully accelerated off the application processor anyways, this doesn't seem like a huge ask.
I wouldn't consider myself an expert in audio at all. However, I have been bickering about this for years and I haven't seen any coherent argument why Apple shouldn't support Opus. Every other browser engine, desktop and mobile, has long figured it out, and it certainly doesn't seem to be a huge issue.