Opus Audio Codec – FAQ
wiki.xiph.org
wiki.xiph.org
But I also suspect that popular wireless codecs (i.e. Dolbly's AptX, MPEG's AAC, and Samsung's Scalable) are powered by marketing fluff. I'd love an informed opinion :D
Interestingly one of the most power efficient lossy codecs is still ATRAC, Sony's MiniDisc codec, specifically designed to sip lightly at your AA batteries.
One big benefit to Opus on Bluetooth devices is that a lot of content, particularly Spotify, YouTube, and Netflix, is already in Opus; so presumably if one application is playing then it should be possible to just proxy the frames right over the wire without reencoding; switching to decoding and mixing when system sounds play is also pretty straightforward in that case.
AptX HD is probably the most reasonable Bluetooth codec deployed right now, but it is proprietary to Qualcomm. LDAC is by far the silliest codec, it is very Sony, and designed for audiophools, but at least it's free and deployed on every Android device.
I don't know if that's good enough to satisfy someone who purchases them, but it is what it is... I think you're probably right about active current consumption though, especially if you're using a modern MCU.
If there's a talk or lecture on Youtube that you're about to grab, try the 50kbps Opus version and save your limited space for more important things, but you might need to remux from webm to an ogg container for compatibility.
e.g. youtube-dl -f249 $URL --exec 'ffmpeg -i {} -vn -c:a copy {}.ogg'Source: I am a co-author on RFC 6716 and RFC 7845.
So why wouldn’t opus audio only in an MP4 container be playable everywhere those things are as well?
I really think we need to stop overloading the .MP4 file extension and standardize “.av1opusmp4” or “.h265opusmp4” or similar even though it is still an MP4 container. Even .webm is now overloaded with two codec generations.
We don’t get a “codecs” HTML attribute in a file system (at least not portably).
Why not just `youtube-dl -x` ?
For example, an hour-long performance video mp4 at 1280x720 gets you 96k audio and 280MB. 'youtube-dl -f 251 url' will get you a 160K Opus in 54 MB.
To my ears Opus sounds sweeter and fuller than mp3. At 64K and lower bit-rates, it's near the top.
Edit to add: I had my whole collection encoded with Opus at one point, and could never discern it from the FLACs in a few ABX tests I ran. It’s only theoretical problems that were nagging at me that made me switch back, nothing I actually heard.
Why is that an issue? I don't think you'll hear any difference if the Opus encoding is resampled to 48khz.
Obviously with low pass filtering for artifacts due to the nyquist frequency. But you are correct that it won't be a one-to-one correspondence between the audio samples like you'd get if it divided evenly.
If you had 24kHz encoded music would it bother you if it got upsampled to 48kHz? What if it was 26kHz? I think the prior would bother me less because I know the samples are synchronous in the two time bases.
As for playback, most likely your sound card is already running at 48kHz; 44.1kHz may actually not be supported properly by your DAC (I guess since it requires a higher quality anti-aliasing filter). As [1] continues to explain, Opus is essentially shifting the burden of resampling to the encoding rather than the decoding side of things.
That being said, Opus technically supports odd sample rates such as 44.1kHz, but this has to be signalled in a side-channel. See [1] downwards.
[1] https://wiki.xiph.org/OpusFAQ#What_is_Opus_Custom.3F
edit: clarity
This should not matter to me personally, as I have proven to myself that pretty low bitrates are transparent to me, regardless of the codec. But... I have the same psychosis that a lot of people have, where I think I can hear differences when I know which is which.
If space were an issue I'd use 90kbit/s opus (that was the threshold for me in my testing). It's actually pretty amazing, but since I have the storage space, I archive FLAC and carry around 256kbit/s vorbis, and don't even question the quality. It's easier to use more space than to fix my faulty perception!
If there's a static scene it encodes it at super high quality (but makes up for it by saying "don't change" for a while).
But if there's a fast scene a lot of details can get smudged without anyone noticing. I think people only tend to notice block artifacts with steps in luminosity during dark scenes, but I think you have to have a really bad encoding for that to be an issue in 2020.
It was hard to imagine then, but not only do we now have cheap enough storage to store more music that you will ever listen, bandwidth and Internet speed has becomes so cheap we can now afford to stream it.
So in an interesting turn of event, the major usage is now 128Kbps and above. So often I see lots of 1-2Mbps Video Files having 256Kbps AAC within it. ( Normally you would put 128Kbps Audio and save those bitrate for Video ) And bandwidth and Data are only going to be cheaper in the coming 10 years.
In terms of Standard 128Kbps bitrate and above, AAC-LC in on par with Opus. And AAC-LC is officially patent free, as all patent has expired. HE-AAC v1 will be patent free as well in 3 years time.
Unless you are doing anything that focus on sub 64Kbps, you have an Audio Codec that is not just royalty free with patent grant, but free of patents, and it is extremely good.
I hope one day we would have a decent patent free video codec too.
Do you have any statistics to underpin this weird claim?
Opus is the obvious choice for a wide range of applications that don't want transparent music reproduction and couldn't afford 128kbps if they wanted to.
Down below 6kbps where Opus can't go there's Codec 2 (down to a few hundred bits per second) but I don't see that on the Internet.
I don't have any hard data on this, but I'm pretty sure that Opus produces better quality audio at 64 kbps than a 2000 MP3 encoder does at 128 kbps. A current version of LAME will probably be as much better than some old Fraunhofer encoder as Libopus is better than LAME.
On another point, is Opus a popular format, given that alot of people now stream stuff mostly? IIRC, some of the Quake engines support it.
MP3 and FLAC are by far still dominant. Ogg is still popular I. It’s niche (eg game sounds, and I think Spotify uses it too)
You have likely heard one. For instance, if you are a Youtube user.
Yes, it's one of youtube's standard audio formats.
> Can browsers natively play them?
Yes.
By the time this was sorted MP3 had gained massive popularity on "teh scene" and was soon followed by napster etc - the rest is history, so yes it's all about the "brand recognition" now sadly.
Most people could have a better sounding music collection in about half the size required for MP3 safely... still at least disk space is cheap these days.
The unfixable problem of MP3s "shortest allowable blocksize" causing audible smearing on transients will be with us until the format is abandoned, but I won't hold my breath.
These days for the best quality lossy audio you want AAC-LC encoded with either Apples encoder or the open source FDK-AAC by Fraunhofer (developed for Android) but fully cross platform... or Opus for a completely free and open codec , but still not yet as widely compatible.
More than that - scene releases required MP3 (LAME V2 IIRC) to be used.
If you don't care too much about file size (LAME -V0 is ~256 kbps), it's a decent option for many purposes.
Unfortunately, the companies whose business is audio invariably have some sort of relationship with patented, shittier formats like AAC or even more obscure stuff that only exists to collect royalties like aptX, so they aren't going to market Opus to you as a consumer of audio formats or a feature in audio related products, nor promote support and compatibility across devices. And so you pay more, and get an inferior product :-)
Virtually every video chat system uses it. Hangouts, Zoom, WhatsApp, etc
We have been capturing then encoding audio using Opus from a low-power chip (nRF52840) then sent encoded data through BLE.
Worked liked a charm! Encoding used 50% of the CPU time.
Are all browsers supporting it now? I remember in the past Apple staunchly refused to support Opus and Ogg container. Is it better now after they joined Alliance for Open Media?
Apple being Apple. While they "support" it, looks like they can't even do it properly.