Mozilla

Firefox Beta 15 supports the new Opus audio format


Firefox Beta logo

Firefox 15 (now in the Beta channel) supports the Opus audio format, via the Opus reference implementation.

What is it?

Opus is a completely free audio format that was recently approved for publication as a standards-track RFC by the IETF. Opus files can play in Firefox Beta today.


Opus audio codec logo

Opus offers these benefits:

  • Better compression than MP3, Ogg, or AAC formats
  • Good for both music and speech
  • Dynamically adjustable bitrate, audio bandwidth, and coding delay
  • Support for both interactive and pre-recorded applications

Why Should I care?

First, Opus is free software, free for everyone, for any purpose. It’s also an IETF standard. Both the encoder and decoder are free, including the fixed-point implementation (for mobile devices). These aren’t toy demos. They’re the best we could make, ready for serious use.

We think Opus is an incredible new format for web audio. We’re working hard to convince other browsers to adopt it, to break the logjam over a common <audio> format.

The codec is a collaboration between members of the IETF Internet Wideband Audio Codec working group, including Mozilla, Microsoft, Xiph.Org, Broadcom, Octasic, and others.

We designed it for high-quality, interactive audio (VoIP, teleconference) and will use it in the upcoming WebRTC standard. Opus is also best-in-class for live streaming and static file playback. In fact, it is the first audio codec to be well-suited for both interactive and non-interactive applications.

Opus is as good or better than basically all existing lossy audio codecs, when competing against them in their sweet spots, including:

General audio codecs (high latency, high quality)
  • MP3
  • AAC (all flavors)
  • Vorbis
Speech codecs (low latency, low quality)
  • G.729
  • AMR-NB
  • AMR-WB (G.722.2)
  • Speex
  • iSAC
  • iLBC
  • G.722.1 (all variants)
  • G.719

And none of those codecs have the versatility to support all the use cases that Opus does.

Listening tests show that:

That’s a lot of bandwidth saved. It’s also much more flexible.

Opus can stream:

  • narrowband speech at bitrates as low as 6 kbps
  • fullband music at rates of 256 kbps per channel

At the higher of those rates, it is perceptually lossless. It also scales between these two extremes dynamically, depending on the network bandwidth available.

Opus compresses speech especially well. Those same test results (slide 19) show that for fullband mono speech, Opus is almost transparent at 32 kbps. For audio books and podcasts, it’s a real win.

Opus is also great for short files (like game sound effects) and startup latency, because unlike Vorbis, it doesn’t require several kilobytes of codebooks at the start of each file. This makes streaming easier, too, since the server doesn’t have to keep extra data around to send to clients who join mid-stream. Instead, it can send them a tiny, generic header constructed on the fly.

How do I use it in a web page?

Opus works with the <audio> element just like any other audio format.

For example:

 <audio src="ehren-paper_lights-64.opus" controls>

This code in a web page displays an embedded player like this:


Paper Lights by Ehren Starks Creative Commons License

 
(Requires Firefox 15 or later)

Encoding files

For now, the best way to create Opus files is to use the opusenc tool. You can get source code, along with Mac and Windows binaries, from:

http://www.opus-codec.org/downloads/

While Firefox 15 is the first browser with native Opus support, playback is coming to gstreamer, libavcodec, foobar2000, and other media players.

Streaming

Live streaming applications benefit greatly from Opus’s flexibility. You don’t have to decide up front whether you want low bandwidth or high quality, to optimize for voice or music, etc. Streaming servers can adapt the encoding as conditions change—without breaking the stream to the player.

Pre-encoded files can stream from a normal web server. The popular Icecast streaming media server can relay a single, live Opus stream, generated on the fly, to thousands of connected listeners. Opus is supported by the current development version of Icecast.

More Information

To learn more visit opus-codec.org, or join us in #opus on irc.freenode.net.

35 comments

Comments are now closed.

  1. Henri Sivonen wrote on July 19th, 2012 at 22:33:

    “Better compression than” … “Ogg” should probably say “Vorbis” instead of “Ogg”.

    1. Bernd wrote on July 20th, 2012 at 20:48:

      “Better compression than [...] Ogg [...] formats” – In the family of “Ogg formats” there is also Speex as a codec that covers some of Opus’ use cases. The sentence just doesn’t mention Vorbis explicitly. But the family name of Vorbis may be more popular anyway…

  2. Giuseppe Bilotta wrote on July 20th, 2012 at 00:05:

    The sample works perfectly in Opera 12 already.

    1. Style Thing wrote on July 20th, 2012 at 09:41:

      this is really good news! the more the better ^^

    2. Bernd wrote on July 21st, 2012 at 09:45:

      I can’t reproduce using Opera 12.00.1467/Presto 2.10.289 or 12.50.1513/Presto 2.11.310 on Ubuntu 11.10 32bit (gst-plugins-bad v0.11.92 installed); heard of somebody else failing, too.
      No word on Opus on official website opera.com on Opus codec.

      1. Bernd wrote on July 21st, 2012 at 10:33:

        er – gst-plugins-bad v0.10.23, of course.

    3. Bernd wrote on July 24th, 2012 at 06:30:

      Now that I’ve installed libopus and fixed my GStreamer installation it works for me too.

      So, support is not built in; they use different external backends and support whatever they support, it seems: http://my.opera.com/community/forums/topic.dml?id=1491802#comment12779922

  3. Anonymous wrote on July 20th, 2012 at 15:49:

    Any plans to support Opus audio in a video container along with VP8 or similar? Any plans for a new revision of WebM?

    1. Bernd wrote on July 20th, 2012 at 20:21:

      Since the container format of WebM is a subset of Matroska we first need Matroska to work with Opus. That is being worked on: http://googlecode.com/p/webm/issues/detail?id=453

  4. Jean-Marc Valin wrote on July 20th, 2012 at 19:16:

    At this point, I’m not aware of any plans for Opus in WebM, though we never know. Technically, even if Opus was 50% more efficient than Vorbis, the total saving when counting video wouldn’t be that big. Of course, when we look into a new standard Opus would really make sense. For something like WebM, the main reason I would see to move to Opus would be about convenience, e.g. if there was a use-case for recording webrtc video that’s already encoded with VP8+Opus.

  5. Wolfgang wrote on July 21st, 2012 at 04:33:

    Zeitstempel: 21.07.2012 13:32:21
    Warnung: Medien-Ressource http://people.xiph.org/~giles/2012/opus/ehren-paper_lights-64.opus konnte nicht dekodiert werden.
    Quelldatei: http://hacks.mozilla.org/2012/07/firefox-beta-15-supports-the-new-opus-audio-format/
    Zeile: 0

    with Firefox 15.0b1 for me

  6. bubba wrote on July 21st, 2012 at 14:02:

    I’m running Opera 12.00.1467 on Debian testing and the audio clip played OK. I have the base/good/bad/ugly/ffmpeg gstreamer plugins installed.

  7. Wolfgang Keller wrote on July 21st, 2012 at 16:15:

    Unluckily the multichannel test vectors from
    http://people.xiph.org/~greg/opus_testvectors/opus_multichannel_examples/
    (linked from http://www.opus-codec.org/docs/#testvectors) don’t work. Please fix this bug.

    This said: great job.

    1. Ralph Giles wrote on July 25th, 2012 at 13:00:

      We’ll fix the bug. Multichannel support is scheduled for Firefox 17, and should be out in December. Firefox 15 and 16 only support stereo and mono files.

  8. PuX wrote on July 21st, 2012 at 18:07:

    after reading all this I can understand flexibility is the strong point of this new codec, but why exactly would anyone use this for streaming music instead of any other lossy codec with the objective of making it sound better? why not just go for lossless?

    1. sear wrote on July 22nd, 2012 at 22:43:

      For streaming purposes, better sound at lower bitrates is always a good thing. To my knowledge, HE-AAC is considered the streaming gold standard right now. The claim that this codec bests it is great news!

    2. Bernd wrote on July 24th, 2012 at 07:08:

      Some people sometimes have to meet various bitrate constraints. With internet radio often your server has limited capacity – so with Opus you can serve more people. And users sometimes have internet lines that can’t handle CD-quality FLAC streams.
      And then you sometimes have varying network conditions and you can adapt to these on the fly with Opus.

      Opus creates a lot of new possibilities – and for some people they are useful sometimes. If FLAC is for you, go for it. If you come across constraints like the described ones you may want to remember Opus…

      1. PuX wrote on July 26th, 2012 at 16:47:

        I can see your point. Almost forgot that sometimes internet connection is so bad that it can’t handle 1000 kbps, which would be enough for usual cd-audio quality. So, yeah. If this codec can efficiently adjust the bitrate on the fly, I can see why this is cool.

        1. panzi wrote on September 11th, 2012 at 17:59:

          In what kind of utopia do you live where you have a 1000 kbps connection? 250 kbps is standard here.

          1. Steve wrote on September 12th, 2012 at 18:46:

            I’ve got a 17mbps connection. (Bog standard ADSL2+).

            (aka 2mbps, 2000kbps)

            200kbps is ISDN territority. Dialup is 56kbps.

            I think you’re confusing your K’s with your k’s.

          2. Ouch wrote on November 13th, 2012 at 21:52:

            You mean ‘B’s with his ‘b’s
            Byte = 8 bits right?

            When you download, the browser tells you KBytes/sec. When you play, the player tells you KBits/sec, and when you pick an internet plan, they show you KBits/sec.

            Y u no make one standard?

  9. austin wrote on July 24th, 2012 at 07:01:

    http://imgs.xkcd.com/comics/standards.png
    just what i thought of when reading this…

    1. Bernd wrote on July 24th, 2012 at 07:12:

      The writers were thinking of that too. Have you noticed the link behind “break the logjam”?.. ;-)

      1. austin wrote on July 27th, 2012 at 08:10:

        totally didnt…

  10. kizi wrote on July 26th, 2012 at 15:19:

    this is really good news! the more the better ^^

  11. Caspy7 wrote on August 2nd, 2012 at 17:09:

    Is there any work going on to get support into Android?

    1. Bernd wrote on August 13th, 2012 at 08:46:

      I think so: Support in Rockbox is underway: http://www.rockbox.org/mail/archive/rockbox-dev-archive-2012-08/0007.shtml
      With “Rockbox as an Application” (RaaA, http://www.rockbox.org/wiki/RockboxAsAnApplication2010) you should then be able to play Opus on Android.

      1. Caspy7 wrote on August 13th, 2012 at 08:58:

        This I understood, but that’s not quite the same as getting native support in Android.

        1. pow wrote on August 26th, 2012 at 19:50:

          Opus works for me on Firefox Beta on Android, at least over wi-fi. The Android version is Gingerbread that came with the phone.

  12. pd wrote on August 2nd, 2012 at 21:33:

    Tried the encoder, very fast, very good sound at 256 CBR. Also appears to compress well. I got a result of an 82% reduction from a wav file (Morning Mr Magpie by Radiohead) and the sound was excellent. I used the –music profile naturally.

    I’d also like to see Firefox on Android support this codec. Perhaps Aurora for mobile already does?

    1. pow wrote on August 26th, 2012 at 19:52:

      Firefox Beta on Gingerbread plays the Opus sample in the article for me. (Tested over wifi).

  13. sylock wrote on September 4th, 2012 at 07:35:

    Hello,

    I’m curious, is there any plan to support some kind of encryption of something like this. I explain why. I’m using Deezer because I like searching for some music and listen to it quickly and from everywhere.

    I read that Deezer changed their interface to fit html5 except for audio flow which use Flash since nothing except Flash can handle encryption and so “guarantee” them that the music won’t be copyied.

    I really want to see something else replacing that feature of Flash to be able to use Deezer without the flash plugin installed.
    I’m talking about my use case but I suppose I’m not the only want ;)

  14. Ralph Giles wrote on September 4th, 2012 at 13:01:

    We have no plans to implement content scrambling for media streams. Such techniques are mostly useful to limit user action and create lock-in, which is counter to our mission.

    Mozilla will likely implement the MediaSource api, or something like it, which would permit websites to implement their own over-the-wire transforms, control buffering, report more accurate transit statistics and so on.

    http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html

  15. sylock wrote on September 4th, 2012 at 22:31:

    So if I understand well, media source is like an extension of the current html5 video and audio tags?

    1. Ralph Giles wrote on September 11th, 2012 at 21:51:

      That’s right. It’s an extra interface on the video and audio tags that lets you feed compressed data streams from local javascript rather than directly from your server. A bit like the AppendBytes method in ActionScript.

Comments are closed for this article.