Supported Libopus Audio Frame Sizes in Milliseconds

This article provides a direct overview of the exact audio frame sizes, measured in milliseconds, supported by the libopus library. It outlines the specific frame durations available in the Opus codec, how they affect audio transmission, and the trade-offs between latency and bandwidth efficiency.

The libopus library, which implements the IETF Opus Audio Codec (RFC 6716), supports a specific set of audio frame sizes. These frame sizes dictate the duration of audio digitized and packaged into a single payload.

Exact Supported Frame Sizes

The native audio frame sizes supported by libopus are:

Maximum Packet Duration

While individual frames are restricted to the sizes listed above, libopus can combine multiple frames of the same size into a single packet (using Opus “Packet 3” configurations). The maximum total duration of a single encoded Opus packet is 120 ms.

This means a single packet can contain: * Two 60 ms frames (120 ms) * Three 40 ms frames (120 ms) * Six 20 ms frames (120 ms) * Twelve 10 ms frames (120 ms)

Frame Size Trade-offs

Choosing the right frame size involves balancing latency and overhead: