
It’s Opus, it rocks and now it’s an audio codec standard - nullc
https://hacks.mozilla.org/2012/09/its-opus-it-rocks-and-now-its-an-audio-codec-standard/
======
kibwen
Before someone chimes in with that XKCD strip:

 _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._

[http://wiki.xiph.org/OpusFAQ#How_does_Opus_compare_to_other_...](http://wiki.xiph.org/OpusFAQ#How_does_Opus_compare_to_other_codecs.3F)

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."_

~~~
wissler
There is no such thing as "unencumbered by patents". Unless you have a
technology that has already been tested thoroughly in the courts, which is the
only way you can really determine whether something would be deemed to violate
a patent or not, you simply can't know.

~~~
azakai
Even if it was tested by the courts, you can appeal. And even after the
appeal, you can appeal to a higher court, all the way to the Supreme. And even
if was tested there, congress can pass a law that allows it. And even if that
happens the Supreme court can strike down the law. And even if that happens,
the public can mount a revolution and tear down the legal system.

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.

~~~
wissler
No matter how many times I'm downvoted, it's still not unencumbered. It's
simply not in the nature of our patent system that something this complex can
be unencumbered, unless it's with respect to an expired patent.

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.

~~~
nullc
Come on, it's only 45kloc. Do you go around insisting every non-trivial piece
of software on hacker news is encumbered?

And in most those cases people were not making a special effort to avoid being
effectively encumbered, while Opus was.

~~~
throwaway64
if its a non-trivial peice of software, it almost certainly is encumbered,
don't forget about idiotic patents like 1 click, there are likely millions.

------
mmphosis
These comments answer some questions I have concerning FLAC...

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._

~~~
masklinn
> 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.

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.

~~~
ZoFreX
If you were using AAC (or anything else that's more advanced than MP3) a 3MB
file would actually be listenable for a short song.

A 150MB FLAC file would be about 20-30 minutes long (based on a typical
bitrate of 700-1000 kilobits per second).

~~~
masklinn
> If you were using AAC (or anything else that's more advanced than MP3) a 3MB
> file would actually be listenable for a short song.

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.

~~~
ZoFreX
Oops, I misread your comment quite heavily. Apologies for the extremely
redundant follow-up!

------
mcantor
I'm not an audio guy. Can anyone explain like I'm five why this new codec was
needed? How does it affect me as a consumer of audio? Who out there was saying
"Gosh, I want to do X, but it's really tough because existing codecs force me
to choose between high quality and low delay"? What is an example of "X" in
that sentence?

~~~
jmillikin
X = {voip, videoconferencing}

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.

------
mtgx
I expect Firefox and Chrome to adopt this within months, but IE10 is coming
out soon. Does it mean it won't have it? And then we'll have to wait another
year or more for IE11 to implement it? Not to mention IE9 and IE8 will
probably never get it.

I also assume WebM will replace Vorbis with Opus very soon?

~~~
azakai
> I expect Firefox and Chrome to adopt this within months,

Firefox already adopted it (it's in nightly builds). Chrome seems to have
WontFixed it,

<http://code.google.com/p/chromium/issues/detail?id=104241>

~~~
nullc
It's actually in Firefox 15, not just nightly. People on Reddit are saying
chrome's position has reversed but I don't have a link. Works in Opera already
if you have gstreamer's opus plugin, and they've apparently said they'll ship
it.

~~~
azakai
The chrome bug just changed from WontFix to Available.

------
AceJohnny2
I'm not familiar with Opus. Can someone tell me if it is able to dynamically
adapt quality based on available bandwidth? If it loses packets in the stream,
do we get a 'skip' in the audio or does the quality go down?

~~~
tveita
> Can someone tell me if it is able to dynamically adapt quality based on
> available bandwidth?

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. [1]

Some properties of the encoding facilitate this: for instance, packets can
optionally include a reduced-bitrate encoding of the previous packet to
provide redundancy. [2]

[1] <http://tools.ietf.org/html/rfc6716#section-2.1.8>

[2] <http://tools.ietf.org/html/rfc6716#section-4.4>

------
YokoZar
How does Opus compare to Celt, its direct predecessor?

~~~
derf_
The final version of libcelt is bit-for-bit compatible with Opus. Unlike SILK,
there was never a "stable" version of CELT (we routinely broke the bitstream
on almost every commit), so CELT development continued after the two codecs
were merged, right up until the Opus bitstream was frozen.

That makes Opus a strict superset of CELT, and we've stopped maintaining
libcelt, so any existing users should switch to libopus.

------
sandGorgon
Relevant - Hydrogenaudio listening tests (530 tests) scored Opus higher than
HE-AAC

<https://people.xiph.org/~greg/opus/ha2011/> <http://listening-
tests.hydrogenaudio.org/igorc/results.html>

------
nvmc
MP3 is getting very long in the tooth, not to mention the fact that it's
encumbered by patents. A new codec would be nice, but hardware adoption of the
codec will take a while. Long enough, dare I say, to kill it dead in the
water.

~~~
randallu
Why would you say that?

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.

~~~
wmf
The problem is that they never develop firmware updates so if those DSPs don't
support yet another open codec on release day, they never will.

~~~
randallu
I'm pretty sure Tegra2 got firmware updates during its lifetime, and I know
that TI do updates for OMAP.

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.

