To create a HDR10 video out of sRGB jpegs I use following script:
PHP Code:
import vapoursynth as vs
from vapoursynth import core
x = core.imwrif.Read("C:/Users/Walter/Documents/SMIL/BSG23/testsuite/OLED/vapoursynth/colorcheckerchart4k.jpg", firstnum=0, mismatch=False, alpha=False)
x = x * 120
x = x.text.ClipInfo()
x = core.resize.Bicubic(x, format=vs.YUV420P10,
primaries = 9, primaries_in =1,
transfer_s = "st2084", transfer_in_s = "709",
matrix_s = "2020ncl",matrix_in_s = "rgb",
range_s = "limited", range_in_s = "full",
chromaloc_s = "center", nominal_luminance=540.0)
y = core.ffms2.Source(source="C:/Users/Walter/Documents/SMIL/BSG23/testsuite/OLED/vapoursynth/colorcheckerchart4k.jpg")
y = y * 120
y = core.resize.Bicubic(y, format=vs.YUV420P10,
primaries = 9, primaries_in =1,
transfer_s = "st2084", transfer_in_s = "709",
matrix_s = "2020ncl",matrix_in_s = "709",
range_s = "limited", range_in_s = "full",
nominal_luminance=540.0)
y = y.text.ClipInfo()
z = x + y
z.set_output()
The colorcheckerchart4k has whites with RGB=(255,255,255). In vapoursynth preview the color panel shows for white YUV=(664,512,512). When setting nominal_luminance=10000 it goes up to (940,512,512). But then all colors are much too bright.
When using transfer_s="2020_10" white is (940,512,512) independent of nominal_luminance. Colors are too bright on TV but can be adjusted with TV settings.
What goes on?
Encodings is done with:
PHP Code:
"C:\Program Files (x86)\VapourSynth\core32\vspipe" --y4m vsresizep10.vpy - | "C:\Users\Walter\Downloads\ffmpeg-20170605-4705edb-win32-static\bin\ffmpeg.exe" -nostats -i pipe: -strict -1 -r 24 -f yuv4mpegpipe - | "x265_x64_10bit.exe" - --y4m --bitrate 40000 --input-csp 1 --level-idc 5.1 --no-open-gop --hdr --aud --hrd --hdr-opt --colorprim bt2020 --transfer smpte-st-2084 --colormatrix bt2020nc --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(5400000,0)" --max-cll "540,400" --output "VSresizeP10.hevc"
PAUSE
muxer -i vsresizep10.hevc -o vsresizep10.mp4
del vsresizep10.hevc
PAUSE