Opus Last Packet Duration
Understand Opus last packet duration measurement — how CallMeter tracks the duration of decoded Opus frames, and what deviations from 20ms reveal about encoder configuration.
Opus Last Packet Duration reports the duration of the most recently decoded Opus audio packet, measured in milliseconds. In standard VoIP configurations, this value is 20ms. Deviations from 20ms indicate unusual encoder settings or adaptive packetization behavior.
Think of it as checking the "size" of each audio chunk being delivered. VoIP audio is sent in regular-sized chunks, and this metric confirms they are the expected size. If the chunks are suddenly larger or smaller, something has changed in the encoder's configuration.
Opus only
This metric applies exclusively to Opus-encoded audio streams. The packet duration is determined by the encoder and decoded by the receiver.
How It Works
The Opus codec supports multiple frame durations: 2.5ms, 5ms, 10ms, 20ms, 40ms, and 60ms. For VoIP applications, 20ms is the standard choice — it balances latency, bandwidth overhead, and codec efficiency.
CallMeter reads the duration of each decoded frame from the Opus decoder and reports the most recent value. This serves as a real-time indicator of the encoder's packetization interval.
Common frame durations and their use cases:
| Duration | Typical Use | Trade-off |
|---|---|---|
| 10ms | Ultra-low latency applications | Higher packet rate, more overhead |
| 20ms | Standard VoIP (most common) | Optimal balance of latency and efficiency |
| 40ms | Bandwidth-constrained links | Lower overhead, higher latency |
| 60ms | Maximum efficiency | Significant latency, not suitable for interactive calls |
Why It Matters
Packet duration is a diagnostic metric that confirms encoder behavior. In normal operation, it should remain constant at the configured value (typically 20ms). Changes in packet duration indicate:
- Adaptive packetization — Some encoders change frame size dynamically based on network conditions or content type
- Configuration errors — Encoder misconfigured with a non-standard frame duration
- Transcoding effects — An intermediary device re-packetizing the audio at a different interval
- Codec mode switches — Opus switching between SILK and CELT modes, which may use different frame sizes
Common Causes of Unexpected Packet Duration
| Cause | Explanation |
|---|---|
| Non-standard encoder config | Encoder configured for 40ms or 60ms frames instead of the standard 20ms |
| SBC re-packetization | Session Border Controller combining or splitting audio frames |
| Adaptive encoding | Encoder adjusting frame size based on network conditions |
| Conference bridge mixing | Bridge re-encoding mixed audio with different frame sizes |
| Codec mode transition | Opus SILK/CELT mode switches during low-bandwidth adaptation |
How to Fix It
- Verify encoder configuration — Confirm that the Opus encoder is set to 20ms frame duration for VoIP use.
- Check for intermediaries — If packet duration changes between send and receive, an SBC or transcoder in the path may be re-packetizing.
- Disable adaptive packetization — If the encoder supports adaptive frame sizing, consider fixing it at 20ms for consistent behavior.
- Review SDP negotiation — Check whether the
ptimeattribute in SDP is requesting a non-standard packetization interval. - Correlate with other changes — If packet duration changes coincide with Opus Bandwidth drops, the encoder may be adapting to poor network conditions.
Related Metrics
- Opus Bandwidth — Codec bandwidth mode; may change alongside frame duration during adaptation
- Opus Packet Loss % — Loss patterns may differ with different frame durations
- Avg Packet Spacing — Network-level timing between packets; should match the frame duration
- Packets Sent Rate — Packet rate inversely correlates with frame duration
Opus Packet Loss %
Understand Opus-level packet loss percentage — how CallMeter measures audio loss from the decoder's perspective, thresholds, and why codec-level loss differs from network-level loss.
Audio Level RMS
Understand overall audio RMS level measurement — how CallMeter tracks the volume of the complete audio signal, thresholds for detecting silence and clipping, and why it matters for call quality.