C.W.K.
Stream
Lesson 02 of 10 · published

Scale Filter Deep Dive

~10 min · scale, resize, lanczos

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Beyond the basics

You met scale in Track 2. The full filter has more knobs:

  • scale=W:H — basic.
  • scale=W:H:flags=lanczos — pick algorithm: fast_bilinear (fast, blocky), bicubic (default), lanczos (sharp), spline (slowest, highest quality).
  • scale=W:H:force_original_aspect_ratio=decrease,pad=W:H:(ow-iw)/2:(oh-ih)/2 — fit-with-letterbox.
  • scale='min(1920,iw)':-2 — only downscale, never upscale (caps at 1920).

Why care about flags

Bicubic is the default. It's fine. Lanczos is sharper, better for text-heavy content (slides, screen recordings). Spline is the slowest, highest quality option. fast_bilinear is for live preview only.

Code

Scaling patterns·bash
# Lanczos for sharpness
ffmpeg -i in.mp4 -vf "scale=1920:-2:flags=lanczos" out.mp4

# Cap at 1080p (don't upscale 720p sources)
ffmpeg -i in.mp4 -vf "scale='min(1920,iw)':-2" out.mp4

# Letterbox to 16:9 (preserve content, pad with black)
ffmpeg -i in_4_3.mp4 \
  -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:color=black" \
  -c:v libx264 -crf 20 -preset slow out.mp4

# Crop-fill to 16:9 (cover, may crop content)
ffmpeg -i in_4_3.mp4 \
  -vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" \
  -c:v libx264 -crf 20 -preset slow out.mp4

External links

Exercise

Take a 4:3 source. Letterbox it to 16:9 1920×1080. Then crop-fill the same source to 16:9 1920×1080. Compare: which preserves all the content, which crops, which has black bars? Then take a 720p source and apply a 'never upscale, cap at 1080p' rule — verify the output stayed at 720p.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.