VP9やAV1でエンコードしたときにつけるHDRメタデータをmkvmergeでつける。指定する値は元の映像と同じ値を指定する。libx265は-x265-paramsから、libsvtav1は-svtav1-paramsから直接指定できる。

オプションは–foo 0:bar形式で、最初の数字は何番目の映像ストリームかの指定。

オプション名 入力値 mediainfo 備考
color-range 1:limited,
2:full
limited or full リミテッドレンジ
colour-primaries 9 BT.2020 色域
colour-transfer-characteristics 16:PQ, 18:HLG PQ or HLG 伝達関数
colour-matrix 9 BT.2020 non-constant マトリックス
chromaticity-coordinates 任意 Mastering display color primaries
white-colour-coordinates 任意 Mastering display color primaries ホワイトポイント
min-luminance 1000未満 Mastering display luminance
max-luminance 10000未満 Mastering display luminance
max-content-light 任意 Maximum Content Light Level MaxCLL
max-frame-light 任意 Maximum Frame-Average Light Level MaxFALL
  • chromaticity-coordinatesは分数ではなく小数を指定する。
    –chromaticity-coordinates 0:red_x,red_y,green_x,green_y,blue_x,blue_y
  • white-colour-coordinatesは分数ではなく小数を指定する。
    –white-colour-coordinates 0:white_point_x,white_point_y

HDR10のPQのとき。
mkvmerge -o output.mkv --color-range 0:1 --colour-primaries 0:9 --colour-transfer-characteristics 0:16 --colour-matrix 0:9 --chromaticity-coordinates 0:0.680,0.320,0.265,0.690,0.150,0.060 --white-colour-coordinates 0:0.3127,0.3290 --min-luminance 0:0.0001 --max-luminance 0:1000 --max-content-light 0:1000 --max-frame-light 0:600 input.webm

HLGのときは–colour-transfer-characteristics 0:18に変更する。

ホワイトポイントの指定。

  • P3D65 (Display)
    –white-colour-coordinates 0:0.3127,0.3290

  • P3-DCI (Theater)
    –white-colour-coordinates 0:0.314,0.351

  • P3-D60 (ACES Cinema)
    –white-colour-coordinates 0:0.32168,0.33767

DCI-P3 – Wikipedia

mediainfoではなくffmpegからHDRメタデータの値を調べるには、ffprobeからside_dataを取得する。数値は小数ではなくmkvmergeが読めない分数なので適宜変換する。

ffprobe -v error input -show_streams -select_streams v:0 -of json

ffprobe の使い方

ffmpegでHDRメタデータの読めないファイルがあるときはmediainfoを併用する。
mediainfo --Parsespeed=1 --Output=JSON input.mp4

読めないデータ:

MasteringDisplay_ColorPrimaries
MasteringDisplay_Luminance
MaxCLL
MaxFALL

MediaInfo – Download

master-displayの値に50000で割った値が–chromaticity-coordinates指定の値になる。

13250 / 50000 = 0.265

P3D65 1000-nits モニターの例:

G(x=0.265, y=0.690), B(x=0.150, y=0.060), R(x=0.680, y=0.320), WP(x=0.3127, y=0.3290), L(max=1000, min=0.0001)
G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)