FFmpeg Bilinear vs Bicubic vs Lanczos Scaling

When resizing video in FFmpeg, choosing the right scaling algorithm is crucial for balancing output quality and processing speed. This article compares three of the most common FFmpeg scaling algorithms—bilinear, bicubic, and lanczos—detailing how they work, their performance trade-offs, and how to choose the best option for your video encoding workflow.

Bilinear Scaling

The bilinear algorithm calculates the color value of a new pixel by taking the weighted average of the four surrounding pixels (a 2x2 grid) from the original image.

Bicubic Scaling

The bicubic algorithm is a step up from bilinear. It analyzes a 16-pixel neighborhood (a 4x4 grid) and uses cubic spline interpolation to calculate the new pixels. This results in smoother gradations and sharper edges.

Lanczos Scaling

Named after Cornelius Lanczos, this algorithm uses a windowed sinc function to interpolate pixels, typically analyzing an 8x8 grid of surrounding pixels (Lanczos3).

Summary Comparison

Algorithm Processing Speed Visual Sharpness Computational Resource Primary Use Case
Bilinear Fast Soft / Blurry Low Live streaming & fast drafts
Bicubic Medium Balanced Medium General-purpose encoding
Lanczos Slow Very Sharp High High-quality upscaling & archiving