167 points · by nullc · 14y ago · 65 comments
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_...
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.
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.
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. [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]
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.
https://people.xiph.org/~greg/opus/ha2011/ http://listening-tests.hydrogenaudio.org/igorc/results.html
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.