Skip to content

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

Meta Engineering 8 min read Case study mediumAdept

Video Invisible Watermarking at Scale

Meta runs ML-based invisible video watermarking (VideoSeal-style) as a custom FFmpeg filter for provenance use cases like detecting AI-generated video and identifying first uploaders. GPU deployment suffered from CPU-GPU frame transfer overhead, missing hardware video encoders, contention across parallel requests and model loading costs, so the team moved to CPU-only inference; with tuned encoder, decoder and PyTorch threading plus sampling parameters, single-process latency came within 5% of GPU and scaled across parallel FFmpeg processes more efficiently. A frame-selection method cut an initial ~20% BD-Rate regression, and crowdsourced manual review was needed because VMAF and SSIM missed watermark artifacts.

Related posts

  • AI Watermarking 101: Tools and Techniques

    Hugging Face easyNovice

    AI watermarking marks generated content with visible or invisible patterns that convey provenance, applied either during generation (requires model access, more robust) or after the fact (works for closed models but not all modalities). For text, LLM watermarks split candidate tokens into "green" and "red" lists based on prior context and boost or forbid them, and detection counts token colors, so short texts yield low confidence and false positives remain a problem. Images can be watermarked at generation (IMATAG) or signed post hoc with C2PA credentials (Truepic), while audio approaches like AudioSeal jointly train an embedder and a sample-level detector that is robust to editing. Related defenses such as Glaze, Photoguard, Nightshade and Fawkes cloak or poison images, and open watermarkers or detectors make removal easier.

  • 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.

  • Building Private Processing for AI tools on WhatsApp

    Meta Engineering hardMaster

    Private Processing lets WhatsApp users send messages to server-side AI features such as summarization and writing suggestions without Meta or WhatsApp being able to read them. Requests run inside confidential VMs, a type of Trusted Execution Environment, with Confidential Compute mode GPUs behind them. Clients authenticate with anonymous credentials and reach the service through an Oblivious HTTP third-party relay that hides their IP and prevents targeting a specific user to a specific machine. They then open an RA-TLS session whose attestation is checked against a third-party log of approved binaries. The service is stateless and forward secure, bans remote shell access, filters logs leaving the CVM, and uses multi-party-reviewed builds, all guided by a threat model covering insiders, supply-chain vendors and malicious users.

  • How Meta animates AI-generated images at scale

    Meta Engineering hardMaster

    Meta made its Meta AI image-animation feature fast enough for billions of users by stacking model optimizations. These include bfloat16 precision, expanding temporal-attention context after the cross-attention projections, DPM-Solver sampling down to 15 steps, and combined guidance and step distillation that turned 32 multi-pass teacher steps into 8 single-pass student steps. TorchScript freezing came first, followed by a move to PyTorch 2.0 compile with context and sequence parallelism. In serving, a load-aware routing table keeps requests in-region and offloads to progressively farther regions as load nears capacity. Because each GPU accepts only one request at a time, retry-based probing for free GPUs started to cascade until execution delay and exponential backoff were added.

  • State of open video generation models in Diffusers

    Hugging Face mediumAdept

    Open video generation models such as HunyuanVideo, CogVideoX, LTX-Video, Mochi-1 and Allegro share a common architecture: T5-style text encoders, a DiT-based denoiser over 3D spatio-temporal tokens, a spatially and temporally compressing VAE, and a scheduler. Diffusers runs them in a few lines of code but they need a lot of memory, about 60 GB for HunyuanVideo at default settings. Benchmarks combining bitsandbytes/FP8 quantization, CPU and group offloading, VAE tiling and layerwise casting bring HunyuanVideo down to about 6.6 GB with little extra latency. Timestep and guidance distillation speed up generation, and the finetrainers repo supports LoRA fine-tuning.

The quest for software engineering knowledge.

Look:
Layout: