Video Codec

2 posts

meta3 min readCurated summary

Adopting AV1 for Real-Time Communication (RTC) at Scale

Meta’s adoption of AV1 for real-time communication has been a multi-year effort focused on codec efficiency, device compatibility, latency, power consumption, and resilience to poor networks. AV1 can reduce bitrate by at least 20% versus H.264/AVC while preserving quality, especially below 100 kbps and for screen content. However, making it practical for mobile video calls required low-complexity encoding, careful decoder selection, and systems designed to avoid freezes caused by bitrate spikes and packet loss. ## Why Meta Adopted AV1 for RTC - AV1 delivers comparable visual quality at substantially lower bitrates than H.264/AVC. - Offline testing showed at least a 20% bitrate reduction on low-end and mid-range devices under Meta’s product settings. - Lower bitrate is especially valuable in real-time calls, where network rates may fluctuate between 10 and 400 kbps. - At a 100 kbps limit, AV1 video remained much clearer than H.264/AVC, which appeared blurry. - AV1 is also well suited to screen sharing: - **Palette mode** efficiently represents frames with a limited number of colors. - **Intra-block copy** predicts repeated patterns within the same frame. - Both tools improve the readability of text and other computer-generated content. ## Challenges of Real-Time Video - RTC requires end-to-end latency below roughly 300 milliseconds; techniques common in video-on-demand, such as multi-pass encoding and extensive buffering, can introduce unacceptable delay. - Sudden bitrate increases can cause freezes. - Network bandwidth changes may require adjustments to resolution or frame rate. - Resolution changes generally require a key frame, producing a temporary bitrate spike. - Packet loss can trigger retransmissions or additional key frames, also increasing the risk of freezes. - Mobile devices must encode and decode video simultaneously, making power efficiency essential. ## Encoder Selection and Complexity - AV1’s advanced coding tools improve compression but can significantly increase encoding complexity. - An open-source AV1 encoder consumed 14% more power than H.264/AVC on a Pixel 8 during testing. - AV1 also used more memory, contributing to application crash regressions. - Meta therefore adopted an internal low-complexity AV1 encoder with power consumption comparable to H.264 baseline. - The encoder supports multiple presets: - Higher-complexity presets prioritize quality. - An ultra-low-complexity preset offers complexity comparable to H.264/AVC. - Meta selects the encoder preset according to device capabilities, allowing AV1 deployment beyond high-end phones. ## Decoder Selection - Although decoding is generally less demanding than encoding, AV1 decoding was still challenging for low-end mobile devices. - Initial tests found real-time decoding failures, video freezes, and audio/video synchronization problems on some devices. - Meta evaluated multiple open-source decoders and selected **dav1d** based on its power efficiency and reliability. Meta’s experience shows that AV1 adoption in RTC requires more than simply enabling a new codec. A practical deployment depends on device-specific complexity controls, efficient decoding, strict latency management, and mechanisms that prevent bandwidth changes or packet loss from interrupting calls.

Read original(opens in new tab)
lineOriginal article

We tested the video call quality (opens in new tab)

To optimize the LINE messenger’s communication performance, LY Corporation conducted an on-site call quality assessment in Thailand to analyze local network conditions and compare performance against rising competitors. The study concluded that while LINE offers superior visual clarity and higher bitrates than its rivals, this high-performance strategy requires a careful technical balance to prevent video freezing in unstable network environments. ### High Video Call Adoption in Thailand * Thailand exhibits the highest video call usage among LINE’s major markets, with video calls accounting for 30.43% of all 1:1 sessions—more than double the rate of Japan or Taiwan. * The surge in usage by competitors, specifically "Messenger A," has necessitated frequent benchmarking to maintain LINE’s market leadership and technical edge. * Thailand serves as the primary testing ground for any updates to video modules due to the local user base's preference for high-quality real-time visual communication. ### On-Site Quality Testing Methodology * The assessment was performed over five days by five engineers across high-traffic locations in Bangkok, such as Siam Paragon and Samron Market, using True and AIS 4G/5G networks. * Engineers focused on Quality of Service (QoS) metrics—including packet loss and jitter—to estimate the actual Quality of Experience (QoE) for users. * Baseline performance for LINE in Thailand was recorded at VGA resolution, with frame rates exceeding 20 FPS and an average latency of approximately 150ms. ### Bitrate Strategy and Performance Trade-offs * LINE utilizes a high-bitrate strategy, capping at 1Mbps on 5G and 600kbps on 4G, to deliver sharper, more defined images than Competitor A. * A "start-at-max" approach is used where LINE attempts to find and utilize the highest possible bitrate from the beginning of the call to ensure immediate high quality. * In contrast, competitors adopt a conservative bitrate strategy, starting low and increasing slowly to prioritize connection stability over visual fidelity. * The trade-off for LINE’s higher quality is an increased risk of "freezing"—defined as a single frame persisting for more than 200ms—when the network becomes congested or unstable. ### Technical Implications for Future Development * The relationship between bitrate and network stability remains a zero-sum trade-off; higher bitrates provide better clarity but increase the likelihood of packet delay and loss at the router level. * LINE’s engineering focus is directed toward optimizing the "initial bitrate" detection logic to ensure high quality without triggering network-induced lag in crowded urban environments. * Continuous tuning of the balance between peak visual performance and consistent playback remains the core challenge for maintaining service quality in the Thai market.