Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th July 2017, 05:02   #1  |  Link
george84
Registered User
 
Join Date: Jan 2012
Posts: 104
REC709 to HDR10 conversion

To create a HDR10 video out of sRGB jpegs I use following script:
PHP Code:
import vapoursynth as vs
from vapoursynth import core
core.imwrif.Read("C:/Users/Walter/Documents/SMIL/BSG23/testsuite/OLED/vapoursynth/colorcheckerchart4k.jpg"firstnum=0mismatch=Falsealpha=False)
120
x.text.ClipInfo()
core.resize.Bicubic(xformat=vs.YUV420P10,
primaries 9primaries_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)
core.ffms2.Source(source="C:/Users/Walter/Documents/SMIL/BSG23/testsuite/OLED/vapoursynth/colorcheckerchart4k.jpg")
120
core.resize.Bicubic(yformat=vs.YUV420P10,
primaries 9primaries_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.text.ClipInfo()
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 --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 
george84 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.