10 ms·
Opus Audio Codec – FAQ
- mxmilkb 6y agohttps://github.com/erikd/libsndfile/blob/master/NEWS#L2 https://github.com/erikd/libsndfile/blob/master/NEWS#L2 "Version 1.0.29 (2020-08-15) * Add support for Opus files."
- xellisx 6y agoSite has been hugged. 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.
- TylerE 6y agoI have never seen an Opus file in the wild. 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)
- prvc 6y ago>I have never seen an Opus file in the wild. You have likely heard one. For instance, if you are a Youtube user.
- tinus_hn 6y agoOn the website? Can browsers natively play them?
- nullc 6y ago> On the website? Yes, it's one of youtube's standard audio formats. > Can browsers natively play them? Yes.
- est31 6y agoMost browsers can play them, except for Internet Explorer and Safari for the mode you usually want to use (webm or ogg container). https://caniuse.com/#feat=opus https://caniuse.com/#feat=opus
- gruez 6y agoIs there a reason why mp3 is still around? AAC has better compression ratios, and support is a non-issue. Maybe mp3 has better brand recognition? Most people know what a mp3 is, but probably wouldn't know what AAC or a .m4a is.
- lozf 6y agoThe roll-out of AAC (which was designed to address the problems with MP3, but was not backwards compatible) was slowed a bit by expensive licensing fees for hardware manufacturers and the lack of a good free encoder (though there were some very poor implementations)... 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.
- jumelles 6y ago> massive popularity on "teh scene" More than that - scene releases required MP3 (LAME V2 IIRC) to be used.
- p1mrx 6y agoMP3 has been around so long that it works with damn near everything, and the last patents expired in 2017, so it's now a completely free and open standard. If you don't care too much about file size (LAME -V0 is ~256 kbps), it's a decent option for many purposes.
- brnt 6y agoThere are no quality open source AAC encoders like there are for MP3.
- knaik94 6y agoWhatsapp audio messages are encoded in opus.
- est31 6y agoOpus files are often enclosed in the Ogg container format, so some of your .ogg files might actually contain an opus stream instead of a vorbis stream. Files with an .opus extension usually use Ogg as container format as well.
- xellisx 6y agoI was originally thinking of Ogg Vorbis....
- marcan_42 6y agoOpus is used by basically every company with an integrated product that they control, who doesn't own patents for inferior formats. That includes basically ~all VoIP software, games, YouTube on Chrome and other supporting browsers, messaging apps with audio features, etc. Basically anyone whose main business isn't audio. Because it's the best codec and it's free. It's be dumb not to use it. And if you control your entire product, you can just add support and use it without worrying about compatibility. 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 :-)
- duskwuff 6y agoAlong with YouTube audio, it's used by Discord for voice chat.
- lozf 6y agoAnd all WebRTC based messaging: Hangouts, Teams, Signal, WhatsApp, Messenger, Skype, etc.
- jimmySixDOF 6y agoSkype default codec is SILk
- deleted 6y ago[deleted]
- lozf 6y agoSorry, yes - Opus combines SILK with CELT was the source of my confusion.
- throwaway189262 6y agoIt's supported by video container formats and widely used. You've probably heard a ton of it watching videos online. Virtually every video chat system uses it. Hangouts, Zoom, WhatsApp, etc
- JoshTriplett 6y agoOpus is the standard audio codec in WebM, alongside VP9 or AV1 video.
- prvc 6y agoAV1 does not appear to have been added yet
- prvc 6y ago... as far as this source is concerned at least: https://www.webmproject.org/docs/container/#video-codec https://www.webmproject.org/docs/container/#video-codec
- p1mrx 6y agoIt's one of the WebM audio codecs; Vorbis was first.
- xellisx 6y agoThinking about it, I got confused and was thinking about Vorbis. D'oh!
- powersnail 6y agoMy experience of using youtube-dl is that the best audio format to download from Youtube and Youtube Music seems to be opus usually. So, even if people don't consciously choose opus, they probably listened to opus files quite often.
- indolering 6y agoOn virtually every platform where trademarks and patent trolling isn't the norm. So you won't see it being advertised because Dolby/Apple/Samsung isn't making money off of it.
- lozf 6y agoThe only point in lossy encoding is to save space / bandwidth. Opus excels at getting good sound quality at lower bitrates. 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'
- derf_ 6y agoYou can replace the --exec 'ffmpeg ...' with just -x (or the long form --extract-audio).
- lozf 6y agoYes, but with opus, that only put's the audio in a .opus container, which isn't as widely compatible as the .ogg container.
- knaik94 6y agoIf you have youtube-dl and ffmpeg installed together on linux or both executables in the same directory on windows, youtube-dl automatically remuxes "incompatible" formats into an mkv file.
- lozf 6y agoYes, that's great for videos, but many audio players don't support matroska containers. Putting the opus audio in an ogg container seems to be most effective to get a playable file for most people, so that's my default suggestion.
- indolering 6y agoI really wish Opus would make it into wireless speakers and headphones. From what I've read, it might not be the most power-efficient format, however, and those tiny earbuds need to be /really/ efficient. 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
- LeoPanthera 6y agoALAC (Apple Lossless) was specifically designed to be power efficient, hence its use in AirPlay. 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.
- TD-Linux 6y agoDoesn't seem to be the case at least in Rockbox, ATRAC is less efficient than Vorbis or MP3: https://www.rockbox.org/wiki/CodecPerformanceComparison https://www.rockbox.org/wiki/CodecPerformanceComparison
- kevingadd 6y agoMaybe ATRAC was designed for the purpose of being efficient when using dedicated hardware without making the hardware expensive to manufacture? It's from the minidisc era so I'm not sure it would have been common for them to use general-purpose CPUs to decode audio by then
- LeoPanthera 6y agoIndeed. Sony made ATRAC ASICs, and I doubt there's one in anything Rockbox supports.
- microcolonel 6y agoOpus decoding in earbuds is totally doable. I've been working on an Opus mode for Bluetooth A2DP, it is a bit of work getting two implementations going, but I don't think Opus on earbuds is any more unreasonable than AAC. 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.
- shmerl 6y agoOpus is great. I encode all my music in Opus for playback (after buying it in FLAC). 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?
- jmvalin 6y agoAll major browsers now implement WebRTC, including Opus support. Also, most browsers now support Opus playback in HTML5, though AFAIK Safari only supports it in the CAF container. See https://caniuse.com/#search=opus https://caniuse.com/#search=opus
- mcraiha 6y agohttps://caniuse.com/#feat=opus https://caniuse.com/#feat=opus Safari (both desktop and mobile) is still problematic
- shmerl 6y agoYeah, too bad. Apple just can never do the right thing.
- richard_todd 6y agoOpus is weird because it can use fewer bits to encode complex sounds, and more bits on simple sounds. MP3/Vorbis/AAC all do the opposite. I’ve read it is because it has relatively poor frequency precision, for which it gains excellent time precision. So, on purer sounds it has to use more bits to maintain accuracy. But it’s so counterintuitive, that when I also consider it can’t do a 44.1k sample rate, I stick with vorbis for high-bitrate CD rips, just so I don’t have to wonder if artifacts are hiding somewhere. I think most of the testing by far has been on the low-bitrate encoding where it really excels. 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.
- clouddrover 6y ago> that when I also consider it can’t do a 44.1k sample rate Why is that an issue? I don't think you'll hear any difference if the Opus encoding is resampled to 48khz.
- richard_todd 6y agoI didn’t hear a difference, and some even claim it’s a benefit since a lot of cheap hardware only speaks 48k, so it’s better to encode for it in advance than resample during playback. But, what can I say? It nagged at me in a totally unscientific way that I can encode without a resample to vorbis, but opus makes me resample.
- neltnerb 6y agoYou're probably noticing that the two numbers are not multiples of one another and time samples are discrete so the only way to convert sample rates between 44.1kHz and 48kHz is by interpolating. Going from 96kHz to 48kHz is easier, you just drop half the samples. 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.
- roddylindsay 6y agoOpus is awesome. Up to 255 audio channels supported!
- mhammerc 6y agoI had good times with Opus. 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.
- ksec 6y ago20 years ago we all wanted 128Kbps MP3 Quality at half the bitrate, AAC-LC ( Yes they somehow market it that way ), MP3 Pro, HE-AAC etc. And yet 20+ years later no single Codec can produce MP3 128Kbps quality at 64Kbps. 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.
- tialaramex 6y ago> So in an interesting turn of event, the major usage is now 128Kbps and above. 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.
- opencl 6y agoYoutube has tons of videos with 50-70kbps Opus.
- widerporst 6y ago>And yet 20+ years later no single Codec can produce MP3 128Kbps quality at 64Kbps 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.
- andai 6y agoOpus uses a neural network to determine which codec to use: https://jmvalin.ca/opus/opus-1.3/ https://jmvalin.ca/opus/opus-1.3/
- spacechild1 6y agoI've been using libopus as the main codec for my audio streaming library. It has all I need: good compression/quality ratio, low latency and multichannel support. Also, the API is quite simple and well designed!