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

해상도 Scaling

~10 min · scale, resolution, aspect-ratio

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

scale filter

해상도 변경은 -vf scale=W:H 통해. Width와 height는 literal pixel (1280:720), special -1 (aspect ratio 보존, 2로 나눠떨어지는 짝수), 또는 expression (iw/2:ih/2) 받아.

Aspect-ratio 안전 scaling

두 dimension 모두 hard-code 하면 video가 squish 될 수 있어. 외울 패턴 두 개:

  • scale=1280:-2 — width 1280, height auto + 짝수로 round (H.264/H.265 짝수 dimension 요구).
  • scale=-2:720 — height 720, width auto.
  • scale=iw/2:ih/2 — 절반 사이즈, 정확한 ratio 보존.

Up vs down scaling

Down은 perceptual 단위로 lossless — pixel 버리는 거. Up은 perceptual 단위로 lossy — pixel 만들어내는 거. scale default는 bicubic, downscale엔 OK, 적당한 upscale엔 acceptable. 공격적 upscale (480p → 4K) 은 AI 도구 (Topaz, esrgan) 또는 Linux의 realesrgan_ncnn filter 고려.

Code

흔한 scale recipe·bash
# 720p로, aspect 보존
ffmpeg -i in.mp4 -vf scale=1280:-2 -c:v libx264 -crf 22 -c:a copy out_720.mp4

# 1080p로
ffmpeg -i in.mp4 -vf scale=1920:-2 -c:v libx264 -crf 20 -c:a copy out_1080.mp4

# 절반 사이즈
ffmpeg -i in.mp4 -vf scale=iw/2:ih/2 -c:v libx264 -crf 23 -c:a copy out_half.mp4

# 정확 dimension force (aspect 다르면 distort)
ffmpeg -i in.mp4 -vf scale=1024:768 -c:v libx264 -crf 23 -c:a copy out_squish.mp4
더 좋은 scaling algorithm — Lanczos·bash
# Pixel 하나하나 중요한 downscale 작업
ffmpeg -i in.mp4 \
  -vf scale=1280:-2:flags=lanczos \
  -c:v libx264 -crf 20 -c:a copy out_lanczos.mp4

# Lanczos는 bicubic보다 sharper sinc 기반 filter. Sharper = 텍스트/라인 있는
# 콘텐츠에 좋고, soft footage엔 약간 더 aliasing.

External links

Exercise

4K source 잡아. 1080p로 두 가지 downscale: default bicubic (scale=1920:-2) 와 Lanczos (scale=1920:-2:flags=lanczos). High-frequency 영역 (텍스트, foliage) 봐. 100% pixel-zoom에서 sharpness 차이 보여? 두 output과 source를 트랙 나머지 위해 저장.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.