PATTERN Cited by 1 source
Latency-aware codec switching¶
Switch the active codec based on encoding or decoding latency feedback, falling back from a higher-complexity codec to a lower-complexity one when real-time performance cannot be sustained.
Structure¶
Two complementary paths:
Local encoding-latency path¶
- Negotiate support for multiple codecs (e.g., AV1 + H.264) at call setup.
- Monitor encoding latency after patterns/adaptive-encoder-preset has been applied.
- If lowest-complexity preset still exceeds acceptable encoding latency → switch to H.264/AVC.
- Encoder preset and codec selection are decided jointly to prevent oscillation (e.g., switching to H.264 then immediately back to AV1 then back again).
Peer decoding-latency path¶
- Each device continuously reports its video decoding latency to the sender via a feedback channel.
- If the sender detects the peer cannot decode AV1 in real-time → switch to H.264/AVC.
- Critical for high-end → low-end call scenarios where the sender can encode AV1 but the receiver cannot decode it fast enough.
Anti-oscillation¶
Codec selection considers hysteresis — the system does not flip back to the higher-complexity codec immediately when one frame's latency dips below threshold. Joint preset + codec decision space prevents ping-ponging.
Additional signals¶
Beyond latency, device health signals (battery level, thermal state) can trigger switching — e.g., low battery → switch to H.264 to extend call duration (Source: sources/2026-06-22-meta-adopting-av1-for-real-time-communication-rtc-at-scale).
Seen in¶
- sources/2026-06-22-meta-adopting-av1-for-real-time-communication-rtc-at-scale — canonical instance as layers 2 and 3 of Meta's codec complexity adaptation.
Related¶
- patterns/adaptive-encoder-preset — the first-resort mechanism before codec switching
- patterns/asymmetric-send-receive-codec — structural outcome of per-direction switching
- concepts/codec-complexity-adaptation — parent concept