Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:Libopus

From ReverseEngineering.wiki
Library
Developer Xiph.Org Foundation, Skype/Microsoft, Mozilla, Amazon and others
Platforms any (portable C, SIMD for x86/ARM)
Versions 1.0 (2012) to 1.6.x
License BSD-3-Clause
Website https://opus-codec.org
On this wiki Facts · Code · Notes · Topics

The reference implementation of the Opus audio codec (RFC 6716; C, BSD-3-Clause): SILK, CELT and the hybrid mode, multistream and, since 1.5, optional neural features, shipped as opus.dll / libopus-0.dll / libopus.so.0 or statically. It codes raw packets only (Ogg Opus needs libogg/opusfile); opus_get_version_string() returns the literal "libopus <version>", which identifies and dates a build.

Overview

libopus is the reference implementation of the Opus audio codec (RFC 6716; C, BSD-3-Clause; patent licence notes in LICENSE_PLEASE_READ.txt): the SILK speech coder (silk/), the CELT music/low-latency coder (celt/), the hybrid glue and multistream/projection APIs (src/), and since 1.5 optional neural features (DRED, LACE/NoLACE, dnn/). It encodes and decodes raw Opus packets only: the Ogg Opus container is handled by separate libraries (libogg + opusfile, libopusenc), by FFmpeg, or by the application. It is shipped as opus.dll / libopus-0.dll / libopus.so.0 or linked statically into browsers, VoIP clients, game voice-chat SDKs, FFmpeg and libsndfile.

Identification

  • Version string: opus_get_version_string() returns "libopus " + the package version, with "-fixed" appended for fixed-point builds and "-fuzzing" for fuzzing builds; git builds have a describe suffix ("libopus 1.6.1-50-g3da9f7a6"). The literal is in the binary.
  • Error strings of opus_strerror(): "success", "invalid argument", "buffer too small", "internal error", "corrupted stream", "request not implemented", "invalid state", "memory allocation failed", and "unknown error" for other codes. These short strings are common words; use them together with the version string.
  • Exports: opus_encoder_create, opus_encode, opus_encode_float, opus_encoder_ctl, opus_decoder_create, opus_decode, opus_decode_float, opus_decoder_ctl, opus_packet_parse, opus_packet_get_nb_samples, opus_repacketizer_, opus_multistream_encoder_create, opus_multistream_decode, opus_get_version_string, opus_strerror; 1.5+ adds opus_dred_, and the development tree at the cited commit also declares opus_encode24/opus_decode24.

Where it appears

Checked here: Unreal Engine 5.8's libsndfile-1.dll (libsndfile 1.2.2) contains "libopus 1.4"; an FFmpeg 9.0 static Windows build contains "libopus 1.6.1-50-g3da9f7a6"; Software:VLC media player 3.0.23 x64 has "libopus 1.3" in plugins/codec/libopus_plugin.dll. Unreal Engine also ships libOpus sources and its own Opus wrappers (not examined).

Code & repositories

  • https://github.com/xiph/opus @ 51bd2e649f4516d103ab9a7f22a768595621e847 · license: BSD-3-Clause (declared by the contributor; GitHub's detector did not recognize COPYING)
    libopus source (silk/, celt/, src/, dnn/), the public API (include/opus*.h) and the Ogg Opus encapsulation draft doc/draft-ietf-codec-oggopus.xml (draft 14 = RFC 7845: OpusHead, OpusTags, granule position and pre-skip rules).
    Tested on: Read at this commit (celt/celt.c version and error strings, include/opus.h, the Ogg Opus draft); OpusHead/OpusTags parsing tested on a generated sample with the Python dumper on Format:Ogg; version strings found in libsndfile 1.2.2 (libopus 1.4) and an FFmpeg 9.0 static build. Not built. · checked 2026-10-17; last activity 2026-10-17

Pitfalls

  • An Opus stream in a game or voice protocol is often just length-prefixed packets without Ogg framing; the first byte of each packet is the TOC (configuration, stereo flag, frame-count code), not a magic number.
  • The decoder always works at 48, 24, 16, 12 or 8 kHz; the "input sample rate" field of OpusHead is informational.

Evidence & references

  • https://github.com/xiph/opus at 51bd2e649f4516d103ab9a7f22a768595621e847: celt/celt.c lines 344-373 (opus_strerror strings, opus_get_version_string), include/opus.h (exported API), COPYING; doc/draft-ietf-codec-oggopus.xml for the Ogg mapping.
  • Binaries read with a Python string scan, nothing executed.