Skip to content

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

Netflix TechBlog 4 min read Case study easyNovice

Multi‑Ratio Video Resizing for Mobile Feed and Marketing

Netflix automatically reframes 16:9 footage into 9:16, 4:5 and 1:1 crops with a "virtual camera" pipeline built in three stages. A neural shot-boundary detector segments the video, and Active Speaker Detection (face detection plus LipFlap) splits conversation shots into sub-shots. Faces are then ranked with saliency, speaker status and size to find a focus region, and temporal reframing locks a static crop for small motion or computes a smoothed panning path for large motion. The algorithm is built into Netflix's internal Clips tool with manual adjustment controls and XML export to Adobe Premiere, and in Netflix's internal test it outperformed Premiere's Auto Reframe on a curated evaluation set.

Assumes: video aspect ratiosface detection basics

Related posts

  • Frames, shots, and scenes: Structuring video for AI workflows

    Mux easyNovice

    Video AI workflows should hand a model the smallest piece of video that still contains the answer: frames for single-instant questions, shots (continuous takes between cuts) for visual change, scenes (grouped shots with narrative meaning) for complete sections, and moments and chapters for viewer-facing excerpts and navigation. Using Markus Eder's ski film The Ultimate Run as the example (18,000 frames, 159 shots, 7 scenes), Mux Robots workflows combine these levels, starting with cheap shot-boundary signals and then adding transcript cues and sampled frames only where they can change the answer. Shot-aware sampling avoids wasting a frame budget on near-identical frames, and transcript-heavy workflows like chapter generation weaken on speech-light content. The same granularity choice applies to embedding-based video retrieval.

  • FineVideo: behind the scenes

    Hugging Face mediumAdept

    FineVideo is a 43K-video, 3.4K-hour dataset distilled from 1.9M English YouTube-Commons videos, annotated with scene splits, narrative details, descriptions and QA pairs. Videos were filtered by word density (≥0.5 words/sec) and by visual dynamism using FFmpeg's freezedetect with an exaggerated noise parameter, leaving 600K. They were then categorized against a custom 126-category taxonomy with Llama 3.1 70B, and a selection algorithm balanced categories, engagement and channel representation to hit 4K hours. Gemini 1.5 Pro lost annotation quality on videos over about 10 minutes and when constrained by complex JSON schemas, so the pipeline has Gemini generate free text and uses GPT-4o in a second step to structure it.

  • How Facebook encodes your videos

    Meta Engineering mediumAdept

    Facebook prioritizes advanced video encodings (VP9, slower H264 recipes) by a Benefit/Cost score instead of hard-coded rules. Benefit is relative compression efficiency at fixed quality, measured by Minutes of Video at High Quality per GB (MVHQ), multiplied by effective predicted watch time adjusted for device codec support. Cost is the normalized compute needed to finish the missing lanes of an encoding family, so priority rises as a family nears deliverability. Next-hour watch time comes from two ML models, one at upload time using creator history and one at view time using the video's watch trajectory. These are trained on rebalanced event data and evaluated with RMSE, MAPE, per-category metrics and threshold-based false positive/negative rates.

  • Building an AI WebTV

    Hugging Face mediumAdept

    The AI WebTV is an experimental 24/7 stream of short clips generated by open-source text-to-video and music models. ChatGPT expands a human-written theme into per-shot prompts. Zeroscope V2 then generates 576x320 clips, and Zeroscope XL upscales them to 1024x576 using the same prompt. FILM frame interpolation smooths the clips and MusicGen adds a soundtrack. A Node/TypeScript orchestrator calls these models on Gradio Spaces via @gradio/client, and FFmpeg concatenates an ffconcat playlist into a low-latency FLV stream sent to an RTMP server (node-media-server). Prompting lessons include specifying camera and subject motion and direction, and repeating full details in every prompt for cross-scene consistency. Frame interpolation can hide rendering artifacts, while known failure modes include reversed motion and prompt words like "IMAX" appearing as text in frames.

  • Building Background Effects for Clips

    Slack Engineering mediumAdept

    Slack's Clips background blur and image replacement run as a browser and desktop pipeline. Webcam frames are read via the Insertable Streams API on a worker thread, downscaled to 256x144, and segmented by MediaPipe's landscape selfie model compiled to WebAssembly. All compositing happens in WebGL shaders. The mask is upsampled and bilateral-filtered to smooth edges. Blur uses a mask-weighted Gaussian that also weights each sample by the mask to prevent haloing. Replacement blurs the mask most where confidence is near 0.5, thresholds it into a crisp edge, blurs the background, then alpha-blends. Edge-detection fusion was prototyped but was too unreliable on noisy or low-contrast regions to ship.

The quest for software engineering knowledge.

Look:
Layout: