ffmpeg

2 posts

meta

FFmpeg at Meta: Media Processing at Scale (opens in new tab)

FFmpeg is central to Meta’s media infrastructure, running tens of billions of times daily. Meta’s heavily modified internal fork became difficult to maintain as upstream FFmpeg evolved, so the company collaborated with the FFmpeg community to upstream key capabilities. Threaded multi-lane transcoding and real-time quality metrics now allow Meta to rely entirely on upstream FFmpeg for VOD and livestreaming. ## Moving Away from an Internal FFmpeg Fork - Meta’s fork had diverged substantially from upstream while supporting specialized requirements. - Maintaining both the fork and newer open-source FFmpeg versions created: - Divergent feature sets - Difficult rebases - Increased regression risk - Collaboration with FFmpeg developers, FFlabs, and VideoLAN enabled the needed functionality to be integrated upstream. ## More Efficient Multi-Lane Transcoding - Meta creates multiple DASH encodings for each uploaded video, varying resolution, codec, framerate, and quality. - Running separate FFmpeg processes wastes resources by repeatedly decoding the same source and starting multiple processes. - A single FFmpeg command can decode once and send frames to multiple encoder instances. - Earlier FFmpeg versions still processed those encoders serially for each frame. - Improved parallel encoder threading, introduced from FFmpeg 6.0 and completed in FFmpeg 8.0, allows encoder instances to run concurrently. - The change reduces compute overhead across Meta’s more than one billion daily video uploads. ## Real-Time Quality Metrics for Livestreaming - Metrics such as PSNR, SSIM, and VMAF measure compression-related visual quality loss. - Traditional FFmpeg workflows calculate these metrics after encoding, which is unsuitable for live video. - Meta needed a decoder after each encoder to reconstruct compressed frames and compare them with the original frames during processing. - FFmpeg’s “in-loop” decoding, available beginning in FFmpeg 7.0, enables real-time per-lane quality measurement within one command. ## Deciding What to Upstream - Meta aims to upstream changes that provide broad value to FFmpeg users. - Infrastructure-specific patches are kept internal when they cannot be reasonably tested or used by the wider community. - Meta’s custom MSVP transcoding ASIC is integrated through FFmpeg’s standard hardware APIs, alongside NVIDIA, AMD, and Intel technologies. - Because external developers cannot access MSVP hardware, Meta maintains and validates those internal patches itself. ## Continued Investment in FFmpeg - Upstream improvements allowed Meta to retire its internal fork for all VOD and livestreaming pipelines. - Standardized hardware interfaces make it easier to combine specialized ASICs with software-based encoding and decoding. - Meta plans to continue contributing to FFmpeg to improve efficiency, reliability, codec support, and media experiences across the industry. Meta’s experience demonstrates that upstreaming broadly useful infrastructure improvements can reduce long-term maintenance costs while strengthening the entire FFmpeg ecosystem.

spotify

Congratulations to the recipients of the 2025 Spotify FOSS Fund | Spotify Engineering (opens in new tab)

Spotify’s 2025 FOSS Fund provided €30,000 to FFmpeg, €15,000 to Mock Service Worker (MSW), and support to the Xiph.Org Foundation. The grants recognize both large, foundational projects and smaller efforts maintained by individuals, emphasizing that Spotify’s technology depends on volunteer-driven open source. Maintainers describe the funds as valuable for development, infrastructure, contributor support, and long-term sustainability. ## Spotify’s FOSS Fund - Established in 2022 to support open source projects that Spotify relies on and its developers value. - The 2025 recipients were: - FFmpeg - Mock Service Worker (MSW) - Xiph.Org Foundation - FFmpeg and Xiph.Org support technologies fundamental to streaming, while MSW is primarily maintained by its creator. - Despite differences in scale, all three projects depend heavily on volunteer contributions. ## FFmpeg: €30,000 - FFmpeg has been actively developed for more than 25 years and supports: - Multimedia encoding and decoding - Transcoding - Muxing and demuxing - Filtering - Streaming and playback - Its goal is to play every multimedia file ever created, making it widely used by hobbyists and companies such as YouTube, Netflix, X, and Spotify. - Maintainer Kieran Kunhya said the project is written almost entirely by volunteers. - The funding will support: - Hardware purchases - Conference travel - Development projects - FFmpeg’s maintainers argue that company donations also raise awareness of the project’s importance and demonstrate responsibility toward critical dependencies. - They identify reliable, long-term funding and dedicated company developers as major unmet needs in open source sustainability. ## Mock Service Worker: €15,000 - MSW is a JavaScript library for API mocking used by Spotify for unit testing and across its web stack. - Creator Artem Zakharchenko is the project’s sole full-time maintainer, supported by a small group of active contributors. - Major 2025 improvements included: - A new Interceptors architecture - Custom mock agents operating at the Node.js `node:net` level - First-class Server-Sent Events support - Planned work for 2026 includes: - A redesigned internal architecture - A new approach to request interception - Remote request interception, a technically difficult feature under development for several years - The previous Spotify grant primarily helped Artem support himself while working full time on open source. - The new funding will directly support continued MSW development and efforts to make external contributions more financially sustainable. - Artem notes that many contributors have been reluctant to accept payment, creating an ongoing challenge in building a sustainable maintainer and contributor community. ## Xiph.Org Foundation - The post identifies the Xiph.Org Foundation as a 2025 recipient and groups it with FFmpeg as a project representing technology fundamental to streaming. - The provided text does not include further details about the foundation’s grant amount, projects, or maintainer comments. Spotify’s grants illustrate how companies can support both major infrastructure projects and individual maintainers. Recurring funding, paid development time, contributor compensation, and practical resources such as hardware and conference travel remain important to the long-term health of open source.