Maximum Frame Size Supported by Opus Audio Format
This article provides a direct answer to the maximum frame size supported by the Opus audio format, detailing the specific millisecond limits, how these frame sizes are structured, and the practical implications of choosing different frame sizes for audio quality and latency.
The maximum frame size supported by the Opus audio format is 120 milliseconds (ms).
While Opus natively defines individual frame sizes of 2.5 ms, 5 ms, 10 ms, 20 ms, 40 ms, and 60 ms, the specification allows for multiple frames to be combined into a single packet. By packing multiple 60 ms frames together, Opus can achieve a maximum total packet duration of 120 ms.
Frame Sizes and Latency Trade-Offs
The choice of frame size in Opus directly impacts both latency and compression efficiency:
- Low Latency (2.5 ms to 10 ms): These ultra-short frame sizes are designed for real-time interactive applications, such as live voice communication, online gaming, and musical collaboration, where minimizing delay is critical. However, smaller frames require more packet overhead, which reduces overall compression efficiency.
- Default/Standard (20 ms): The 20 ms frame size is the most common default for voice over IP (VoIP) applications, offering an optimal balance between low latency and high bandwidth efficiency.
- High Efficiency (60 ms to 120 ms): These larger frame sizes are ideal for scenarios where latency is not a concern, such as music streaming, broadcasting, or archiving. Because fewer packets are sent per second, the overhead is significantly reduced, allowing for higher audio quality at lower bitrates.