How does Opus compare to other codecs?
Opus is distinguished from most formats for high quality audio (AAC, Vorbis, MP3) by having low delay and it is distinguished from most low delay formats (G.711, GSM, Speex) by supporting high audio quality. It meets or exceeds existing codecs' quality across a wide range of bitrates, and it operates at lower delay than virtually any existing compressed format. Further, the Opus format itself and the reference implementation are available under liberal royalty-free licenses, making it easy to adopt, compatible with free software, and suitable for usage as part of the basic infrastructure of the Internet. See the Opus comparison page for more details.
Which is to say, this isn't (okay, isn't just) a case of having "too many standards"; Opus is legitimately impressive from a technical standpoint. Oh, and it's unencumbered by patents. That's cool.
EDIT: And here's the coolest part of the article that completely took me by surprise:
"The IETF recently decided with “strong consensus” to adopt Opus as a mandatory-to-implement (MTI) codec for WebRTC, an upcoming standard for real-time communication on the web."
Indeed. There may be interesting side consequences for that. The first article comment asks:
> Interesting! Any idea if this will become mandatory to implement for HTML5 audio as well? That’s another area in sore need of a single format that works everywhere.
This means that if a browser supports WebRTC, it has to support Opus, and it then happens that the codec will be available for <audio>. Now that does not mean that <audio> => Opus support, but it will have a (increasingly with time) high chance to be so.
Keep in mind that this strip is a strong contender for the title of "Most Frequently-Posted Link in HN Comment Threads."
That would be an interesting analysis, actually.
But, practically speaking, Opus has extremely good guarantees for being unencumbered, as much as is possible - the people working on it have given licenses to use it, and experts in the field have had a while to go over this stuff. Nothing is 100%, but this is as good as it gets.
The whole point of "tested by the courts" is that it's already gone through the appeals process. As in, you have the final decision you're going to get out of the courts.
But this doesn't mean that something can't be designed in a way which avoids all known, and much unknown risk, and licensed in a way which makes frivolous attack less likely.
The obsessives here somes forget that when we talk about comparing things what matters is the relative merits. The commercial codes are absolutely and uncertainly encumbered. And the commercial codec providers have generally had a poor track record of creating codecs unencumbered by third party rights (mostly because they don't make an effort to: they erroneously assume the regular royalties will satisfy all comers). Opus doesn't have these issues and even compared to most software an effort was made to avoid infringement, but nothing can escape the impossibility of absolute certainty under the current patent system.
I know my position causes a lot of cognitive dissonance with people, because it implies that the system is fundamentally unfair. Well, you can either take the red or the blue pill.
Who said you were wrong? Quite the opposite, I strongly agreed with you - anything can be encumbered, and anything includes this.
But the point is that Opus is as safe as you can possibly be from being patent encumbered. Everything is potentially encumbered, but there are things with higher or lower likelihoods. And there isn't any lower than Opus. If this is still too worrying for you to use, then you can't use any software at all.
And in most those cases people were not making a special effort to avoid being effectively encumbered, while Opus was.
Particularly as you naively think that an expired patent is enough to protect you from the system.
Note that I said with respect to...
Algorithms are already implemented and software which uses them is distributed broadly. Where are their court cases? Until those patent trolls (trolls as in spreading FUD) actually show what those patents are, they can't say that anything is encumbered. And they themselves have no idea about what they are. So whatever lies they spread now, even if it comes from Jobs, is simply irrelevant.
There are far more interesting and HN-worthy things to discuss than the non-Opus-specific fact that the patent system is broken, like its potential applications in WebRTC, the hybrid design that merges Celt and Silk, the fact that having a conversation with someone 50 feet away using Opus can have lower latency than just shouting at them (as demonstrated by Mumble's use of Celt beating the speed of sound down a hallway), etc.
"All video codecs are covered by patents," Jobs wrote from his iPad. "A patent pool is being assembled to go after Theora and other 'open source' codecs now. Unfortunately, just because something is open source, it doesn’t mean or guarantee that it doesn’t infringe on others patents. An open standard is different from being royalty free or open source."
You can bet that if Theora ever got traction and seriously interrupted MPLA's revenue stream, there would be suits. Before that time it'd be pointless for them to sue.
Opus is another story, since Qualcomm and Huawei listed supposedly violated patents, so Opus creators were able to review them and to confirm that those claims are bogus.
When do the lawsuits over PNG begin?
starwed wrote on September 11th, 2012 at 1:29 pm:
Isn’t FLAC already* open and royalty-free?*
Dusk wrote on September 11th, 2012 at 1:40 pm:
FLAC is a lossless codec — it typically generates output at a bitrate orders of magnitude* higher than lossless codecs such as OPUS, and there’s no way to “dial it down”.*
natermer wrote on September 11th, 2012 at 2:30 pm:
You want to archive audio with 100% quality using Flac.
Opus is for were you are willing to give up some amount of audio quality for the ability to massively increase compression ratio. Using low bit rate Opus may yield a 3MB file for a song, were as FLAC may end up being 150MB for the same audio.
What I do for audio is to store it using flac, but encode it on the fly using other codecs for streaming for transfering to devices. That way I always get the best audio quality possible to go along with the best compression possible.
3MB will get you POTS-quality audio though. Lossless codecs usually compress audio to half the original size (so a 150MB FLAC file — for music — will correspond to ~300MB of raw bitstream). Lossy compression to something worth listening to will usually be around 10x compression, so ~30MB for an original 300MB bitstream.
A 35mn song compressed in 3MB probably won't be worth listening to.
A 150MB FLAC file would be about 20-30 minutes long (based on a typical bitrate of 700-1000 kilobits per second).
Even mp3 works for "a short song", that's not the context of my comment though, its context is a 150MB FLAC file (~300MB bitstream) recompressed to 3MB with Opus.
> A 150MB FLAC file would be about 20-30 minutes long
A point I noted in my comment.
Say you wanted to write a live audio chat app to talk to your friends. If you'd chosen the Speex codec, then voice would come over fine, but trying to show off your new guitar skills would fail because what they heard would sound horrible.
If you'd chosen the Vorbis codec, then everything would sound great, but there'd be a weird "lag" between participants, as if one of them were on the moon. Also, adding too many listeners would severely strain your internet connection's capacity.
Opus has latencies as good as Speex, and can be high-, medium-, or low-quality depending on bandwidth needs.
Opus is good and not encumbered by patents, and it has just been standardized.
I also assume WebM will replace Vorbis with Opus very soon?
Firefox already adopted it (it's in nightly builds). Chrome seems to have WontFixed it,
Depends on what you mean. It is a variable bitrate codec, and the encoder can easily adjust the bitrate of the stream.
But you would need a way to discover the available bandwidth and communicate it to the encoder - Opus is just a codec, not a container or streaming protocol.
> If it loses packets in the stream, do we get a 'skip' in the audio or does the quality go down?
The standard doesn't mandate a specific way to deal with packet loss, but the reference implementation tries to handle this gracefully. 
Some properties of the encoding facilitate this: for instance, packets can optionally include a reduced-bitrate encoding of the previous packet to provide redundancy. 
The codec also includes a pretty good packet loss concealer integrated, and can also use forward error correction to reduce the impact of loss.
That makes Opus a strict superset of CELT, and we've stopped maintaining libcelt, so any existing users should switch to libopus.
Silk is very good at speech and Celt is very good at music. It is like having gears in your car. You need low gears for one mode of operation and high gears for another. So they combined the two into one and made a single codec.
I imagine behind the scenes it has a transition mode from one codec to another depending on the configuration parameters.
Most "hardware" decoders are DSPs that run software loaded onto them at runtime. This goes for anything with an OMAP, Tegra or Samsung (Samsung's own decode block) SoC in (that I know for sure) and probably almost everything else. Tegra3 and OMAP4 can decode WebM in hardware, for example.
Those updates might not make it through to consumer devices, but that used to be the case for things like GPU drivers too. Google pushed an updated SGX driver for the Galaxy Nexus with 4.1, and Apple pushes updates to their own drivers every release.
The manufacturers you mention use DSPs for bad reasons - usually the inertia of software already using a coprocessor and not being willing to license a new codec for the general purpose core. Audio decoding and encoding is an extremely low percentage of available CPU, and it's just not worth off-loading it.
Video is another matter, at least when talking about HD. It's still very much worth using special purpose DSPs for that.
For audio, the existence of hardware DSPs is simply not a barrier to entry.
Obviously neither you nor I have a crystal ball, but I see Opus as the PNG of audio codecs - not displacing the lousy but entrenched de-facto standard (GIF/mp3), but slowly taking over at the technological edge.