Library / SDK
xiph/opus avatar
xiph/opus

libopus: RTP bitstreams, Ogg files and the DRED recovery data added in 1.5

Modern audio compression for the internet.

3,395 stars839 forksCLicense varies

At a glance

What is it?
The xiph/opus repository is the reference C implementation of the Opus codec specified in IETF RFC 6716. It builds with autotools, CMake or Meson, ships an opus_demo test tool, and since 1.5 can embed one second of neural recovery data in packet padding.
Who is it for?
Build against libopus if you need an RFC 6716 codec for VoIP, game chat or music in your own C or C++ program, and treat opus_demo as a test harness, never as a file writer. Skip the raw bitstreams for stored files and use Ogg through opus-tools.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • xiph/opus3,395 ★ · +61
Star history
Repository2026-10-082026-11-25
xiph/opus3.3k3.4k

61 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Raw Opus goes over RTP, stored Opus goes into Ogg, and the test tools write neither

Opus is a codec for interactive speech and audio transmission over the Internet. The repository text lists voice over IP, videoconferencing, in-game chat and remote live music performances, and says it scales from low bit-rate narrowband speech to very high quality stereo music. Paired with a container, it also suits stored files such as music distribution, game soundtracks and portable players, uses historically held by MP3, AAC and Vorbis.

This package builds a shared library for encoding and decoding raw Opus bitstreams. Those raw streams belong on RTP, following RFC 7587. Files should use the Ogg encapsulation described in RFC 7845, and the opus-tools package at gitlab.xiph.org provides encoding and decoding of Ogg Opus files. The test tools in this repository carry extra debugging data and cannot support seeking, so a file written by opus_demo is not an Opus file you can distribute.

DRED tucks one second of recovery data into the padding of every packet

Opus 1.5 added a deep learning based redundancy encoder. Its algorithm is called deep redundancy, or DRED, and it embeds one second of recovery data in the padding of each packet to improve audio on lossy networks. Because the data rides in padding, Opus 1.5 is fully backward compatible with prior revisions of Opus. A receiver with an older decoder ignores what it does not understand.

A team initially sponsored by Amazon Web Services developed DRED, open-sourced the implementation and began standardization at the IETF under draft-ietf-mlcodec-opus-extension. The project states that the license behind Opus and its intellectual property position do not change with Opus 1.5. The explanation of how DRED works lives in the README under the dnn subdirectory, and the repository also has a training folder and a create_opus_data.sh script. The original implementation's packet loss concealment is described as excellent; DRED is the addition for harsher networks.

Building from git needs autotools, and the tarball needs only configure and make

A distribution tarball needs two commands:

bash
./configure
make

The git route needs a toolchain first. On Ubuntu or Debian that is git, autoconf, automake, libtool, gcc and make through apt-get. Fedora and Red Hat use dnf with the same package list, older Red Hat and CentOS use yum, and macOS needs Xcode and brew install autoconf automake libtool. Then:

bash
git clone https://gitlab.xiph.org/xiph/opus.git
cd opus
./autogen.sh
./configure
make

On x86, the project says to use a -march= option that allows AVX2. The optional last step, sudo make install, installs the codec libraries. Note that the clone URL is on gitlab.xiph.org, so a GitHub fork is a mirror of that origin. After compiling, an opus_demo executable sits in the top directory.

opus_demo takes a mode, a sampling rate and a bitrate, with loss simulation built in

The usage line is opus_demo [-e] <application> <sampling rate (Hz)> <channels (1/2)> <bits per second> [options] <input> <output>, with a decode form that starts with -d. The application mode is one of voip, audio or restricted-lowdelay.

The options cover the knobs a codec integrator tunes. -cbr enables constant bitrate where the default is variable. -cvbr picks constrained variable bitrate. -bandwidth takes NB, MB, WB, SWB or FB, from narrowband to fullband. -framesize accepts 2.5, 5, 10, 20, 40 or 60 milliseconds, default 20. -max_payload defaults to 1024 bytes and -complexity runs from 0 to 10, default 10. -inbandfec enables SILK inband FEC, -dtx enables SILK DTX, -forcemono forces mono encoding, and -loss simulates packet loss from 0 to 100 percent, default 0.

Input and output are little-endian signed 16-bit PCM files, or Opus bitstreams with simple opus_demo proprietary framing. That framing is why the output is not a distribution format.

make check should run on every new platform, and the RFC 8251 vectors are a separate download

The package includes automated unit and system tests, and the project says they should be run after compiling, especially the first time on a new platform:

bash
make check

Standard test vectors are not in the repository for size reasons. They come from opus-codec.org as a tarball named opus_testvectors-rfc8251.tar.gz. The project gives three commands to fetch and use them:

bash
curl -OL https://opus-codec.org/docs/opus_testvectors-rfc8251.tar.gz
tar -zxf opus_testvectors-rfc8251.tar.gz
./tests/run_vectors.sh ./ opus_newvectors 48000

The vector run compares the build against reference output at 48000 Hz. A port to an unusual embedded target is exactly the case where the first make check and a vector run catch problems before audio does.

Floating point is the default, fixed point is a flag, and C89 compilers still work

The implementation uses floating-point by default. Setting --enable-fixed-point with autoconf, or defining the FIXED_POINT macro in a manual build, compiles it with only fixed-point arithmetic. The project says the fixed-point version has somewhat lower audio quality and is slower on platforms with fast FPUs, and that it is normally used only in embedded environments.

The code compiles with a C89 or a C99 compiler. It avoids undefined behavior but relies on implementation-defined behavior of two's complement architectures: right shifts of negative values behave as floor(a/(2^b)), and conversion to a signed integer of N bits reduces the value modulo 2^N. A target with some other integer representation falls outside what the code supports.

Windows and other build systems have their own guides. See cmake/README.md or meson/README.md, backed by the CMakeLists.txt, meson.build and meson_options.txt files at the top level.

The license sits in COPYING, GitHub shows NOASSERTION, and releases date from 2024

The Opus format and this implementation are subject to the royalty-free patent and copyright licenses specified in the file COPYING. GitHub reports the license field as NOASSERTION, so the automated summary cannot name it, and the top level also holds LICENSE_PLEASE_READ.txt. Anyone shipping libopus in a product should read COPYING directly.

The release list shows v1.5, v1.5.1 and v1.5.2, all stamped 2024-09-11 on GitHub. The last push to the main branch was on 2026-10-23, and the repository is not archived. The source tree is split into celt, silk and dnn directories, with tests, include, doc, scripts and training beside them. The project homepage is opus-codec.org, where the test vector tarball and opus-tools pointers also live.

The repository does not publish quality comparisons against FLAC, AAC or lossless formats, so claims about those belong to other sources.

Editorial conclusion

Build against libopus if you need an RFC 6716 codec for VoIP, game chat or music in your own C or C++ program, and treat opus_demo as a test harness, never as a file writer. Skip the raw bitstreams for stored files and use Ogg through opus-tools. Before you rely on DRED, read the README in the dnn subdirectory and check that your peers' libopus builds include it.

Frequently asked questions

Is Opus high quality?

The project says Opus scales from low bit-rate narrowband speech to very high quality stereo music. Quality depends on the bitrate, bandwidth and complexity options you choose.

How do I build libopus from the xiph/opus git repository?

Install autoconf, automake, libtool, gcc and make, clone from gitlab.xiph.org, then run ./autogen.sh, ./configure and make. A distribution tarball needs only ./configure and make.

Can I save Opus audio to a file with opus_demo?

No. The test tools write bitstreams with extra debugging data that cannot support seeking. Files should use the Ogg encapsulation from RFC 7845, for example through opus-tools.

Official sources

  1. Issues
  2. Project website
  3. README
  4. Releases
  5. xiph/opus on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/xiph-opus.svg)](https://hysenlabs.com/projects/xiph-opus)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/xiph-opus.svg)](https://hysenlabs.com/projects/xiph-opus)

Was this useful?