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

Color Space — BT.709, BT.2020, HDR 안 깨기

~12 min · color, hdr, bt709, bt2020

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

일치해야 할 color metadata 세 field

모든 video 가 color metadata 세 field 가지고, 정확한 재생 위해 일관성 있어야 해.

  • color_primaries — RGB primary 의 chromaticity (camera 가 어느 red, green, blue 캡처한다고 생각하나?). BT.709 = HD/sRGB. BT.2020 = UHD/HDR.
  • color_transfer — gamma curve. BT.709 = SDR. PQ (smpte2084) = HDR10. HLG (arib-std-b67) = 방송 HDR.
  • colorspace — YUV→RGB matrix. BT.709 SDR. BT.2020nc UHD.

HDR trap

HDR source encode 했는데 FFmpeg 이 metadata 안 쓰면 player 가 BT.709 SDR 로 default — 아름다운 HDR clip 이 washed-out 회색으로 보여. HDR 작업 땐 항상 명시적으로 tag.

Code

SDR / HDR 정확히 tag·bash
# SDR (BT.709) — 명시적 tagging
ffmpeg -i in.mp4 \
  -c:v libx264 -crf 20 -preset slow -pix_fmt yuv420p \
  -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
  out_sdr.mp4

# HDR10 (BT.2020 + PQ)
ffmpeg -i hdr_in.mov \
  -c:v libx265 -crf 22 -preset slow -tag:v hvc1 \
  -pix_fmt yuv420p10le \
  -color_primaries bt2020 -color_trc smpte2084 -colorspace bt2020nc \
  -x265-params "hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc" \
  out_hdr.mp4
HDR 싫어하는 platform 업로드 위해 HDR → SDR 변환·bash
# Tone-map HDR PQ → SDR BT.709
ffmpeg -i hdr.mov \
  -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p" \
  -c:v libx264 -crf 20 -preset slow \
  -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
  -c:a copy \
  out_sdr.mp4

External links

Exercise

SDR clip 과 tagged HDR clip 잡아. 둘 다 color_primaries, color_transfer, colorspace probe. Color metadata 보존하며 명시적으로 각각 re-encode. HDR source 없으면 'HDR' tagged YouTube 에서 찾아 (yt-dlp download 가 tag 보존) 결과에 ffprobe.

Progress

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

댓글 0

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

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