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

Quality 컨트롤 — CRF, Bitrate, Tradeoff

~12 min · crf, bitrate, quality, libx264

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

품질 요청하는 두 가지 방법

Software video encoder는 두 가지 quality control을 받아, 어느 걸 쓸지 알아야 해:

  • CRF (Constant Rate Factor) — "이 품질 유지, 파일 사이즈는 결과대로". 낮을수록 좋은 품질. 0 (lossless) ~ 51 (끔찍). libx264는 18–23 이 sweet spot. libx265는 22–28 (HEVC의 CRF scale은 offset). libsvtav1은 25–35.
  • Bitrate (-b:v) — "초당 이만큼의 bit 줘". 품질은 fit하는 만큼. 목표 파일 사이즈가 있거나 network cap 아래에서 stream할 때. Hardware encoder (videotoolbox, nvenc) 는 보통 bitrate 모드 요구; CRF 무시.

Default는 CRF

일회성 작업 95% (YouTube 업로드, 아카이브, 친구에게 전송) 엔 CRF 사용. 품질 요청하고 encoder가 bitrate 알아서 하게. libx264에서 CRF 18은 visually transparent, CRF 23은 일상 시청에 OK.

Bitrate는 어쩔 수 없을 때 (라이브 streaming bandwidth cap, hardware encoder) 또는 정확한 final 파일 사이즈 원할 때 (Track 3 lesson 6) two-pass encoding에 써.

Code

CRF — 품질 target·bash
# Visually transparent, 더 큰 파일 (libx264)
ffmpeg -i in.mp4 -c:v libx264 -crf 18 -preset slow -c:a copy out_quality.mp4

# 웹 친화, ~절반 사이즈 (libx264 default)
ffmpeg -i in.mp4 -c:v libx264 -crf 23 -preset slow -c:a copy out_web.mp4

# HEVC도 같은 idea — 비슷한 perceptual 품질에 더 높은 CRF 주의
ffmpeg -i in.mp4 -c:v libx265 -crf 24 -preset slow -tag:v hvc1 -c:a copy out_h265.mp4

# AV1 (느린 encoder, 작은 파일)
ffmpeg -i in.mp4 -c:v libsvtav1 -crf 32 -preset 6 -c:a copy out_av1.mp4
Bitrate — 파일 사이즈 target·bash
# Single-pass, target ~5 Mbps video
ffmpeg -i in.mp4 -c:v libx264 -b:v 5M -maxrate 5M -bufsize 10M -c:a copy out_5mbps.mp4

# Hardware encoder는 design상 bitrate 사용
ffmpeg -i in.mp4 -c:v h264_videotoolbox -b:v 8M -c:a aac -b:a 192k out_hw.mp4

External links

Exercise

60초 1080p clip 하나 잡아. libx264 -preset slow 로 세 가지 encode: CRF 18, CRF 23, CRF 28. 파일 사이즈 메모 (CRF 6 point 올라갈 때마다 대략 절반). 셋 다 full-screen 시청. 어느 CRF 에서 압축이 보이기 시작해?

Progress

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

댓글 0

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

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