Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 14 min read Case study mediumAdept

Better video for mobile RTC with AV1 and HD

Meta improved 1:1 mobile RTC video in Messenger, Instagram and WhatsApp by moving from H.264 to software AV1 for low-bandwidth calls (under 300 Kbps). AV1's palette mode, intra-block copy and reference picture resampling help with screen content and avoid key frames on resolution changes, and custom scalers plus face-based region-of-interest encoding add further gains. The costs are roughly 3x encoder CPU, a 5-6% battery increase and more out-of-memory crashes. Meta handles these with a hybrid encoder that switches to H.264 mid-call based on CPU, battery or encode time, and by disabling AV1 on low-memory devices. A lightweight in-product PSNR estimate showed about 2 dB gain over H.264, and an HD mode (720p, 30 fps, 3.5 Mbps) for high-end networks required better congestion detection, including ISP throttling detection.

Assumes: video codec basicsWebRTC fundamentalsbandwidth estimation

Related posts

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

    Meta Engineering mediumAdept

    Meta now runs AV1 for real-time video calls on most mobile devices in Messenger and WhatsApp. AV1 gives at least a 20% bitrate reduction over H.264/AVC on low-end and mid-range phones, which matters most below 100 kbps. Getting there took an internal low-complexity encoder with an ultra-low preset comparable to H.264, the dav1d decoder chosen for power efficiency, and binary-size cuts such as trimming the quantization-matrix tool. An ML-based rtc_score model decides which Android devices are eligible, while runtime encode/decode-latency monitoring adjusts presets, falls back to H.264, and allows asymmetric codecs, alongside further rate control and error resilience work.

  • How Meta brought AV1 to Reels

    Meta Engineering mediumAdept

    Meta deployed AV1 encoding and delivery for Facebook and Instagram Reels, using SVT-AV1 for encoding and the dav1d software decoder on iOS and Android because most phones lack AV1 hardware decoders. Encoding uses a two-stage hybrid ABR pipeline: a fast hardware AVC pass at upload builds a convex hull of resolution/CRF points, and videos whose projected watch time crosses a threshold get a second software encode with AVC, VP9 or AV1 at the selected points. On Android, Meta ran a small on-device benchmark to score phone capability for A/B gating, mixed hardware VP9 and software AV1 decoding for ABR lane switches, and prefetched videos to hide decoder startup latency. On iPhone, AV1 cut average Reels bit rate by 12% and raised playback FB-MOS by about 0.6 points.

  • MLow: Meta’s low bitrate audio codec

    Meta Engineering easyNovice

    MLow is a CELP-based low-bitrate speech codec Meta built for calls on poor networks and low-end devices, where ML codecs like Encodec are too compute-heavy. At 6 kbps it delivers wideband audio with a POLQA MOS of 3.9 versus Opus's 1.89 in narrowband, while using about 10% less compute than Opus. The design splits input into low and high bands, encodes the high band with very few bits using shared information, and range-codes the output, which enables SuperWideBand at low bitrates. The lower bitrate also leaves room for in-band FEC where Opus has none (Opus needs 19 kbps), improving quality under heavy packet loss. MLow is live on Instagram and Messenger and rolling out to WhatsApp.

  • FFmpeg at Meta: Media Processing at Scale

    Meta Engineering easyNovice

    Meta retired its long-diverged internal FFmpeg fork by working with FFmpeg developers, FFlabs and VideoLAN to upstream the two capabilities it depended on. Threaded multi-lane transcoding, which decodes once and runs all output encoders in parallel, arrived over FFmpeg 6.0 through 8.0. In-loop decoding in FFmpeg 7.0 enables real-time PSNR/SSIM/VMAF quality metrics for livestreams. Infrastructure-specific patches, such as support for Meta's MSVP transcoding ASIC via FFmpeg's standard hardware acceleration APIs, stay internal and are rebased with extensive validation.

  • Enhancing HDR on Instagram for iOS With Dolby Vision

    Meta Engineering mediumAdept

    Instagram for iOS now preserves iPhone HDR metadata (ambient viewing environment and Dolby Vision) end to end, after FFmpeg-based server transcoding had been discarding it and degrading the image at low screen brightness. Meta upstreamed amve support to FFmpeg, implemented Dolby Vision Profile 8.4 to AV1 Profile 10.4 transcoding with fixes in libaom, SVT-AV1, dav1d and Shaka packager, and on the client extracts Dolby Vision metadata from its own AV1 decode path to feed AVSampleBufferDisplayLayer. A first A/B test showed lower watch time because the metadata added about 100 kbps and slowed loading. Switching to a compressed metadata format cut that to about 25 kbps, which required an FFmpeg bitstream filter and roughly 2000 lines of client-side decompression, and a second test showed increased time in app.

The quest for software engineering knowledge.

Look:
Layout: