FranceBB
26th July 2018, 22:58
Hi,
I have a very particular request.
I've got the raw files of an interview of a famous football player. The interview has been shot in 3840x2160 1.77 FF 10bit BT2020 HDR, 4:2:0 Type 2 with the following specs:
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : SMPTE ST 2084
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : R: x=0.680000 y=0.320000, G: x=0.265000 y=0.690000, B: x=0.150000 y=0.060000, White point: x=0.312700 y=0.329000
Mastering display luminance : min: 0.0000 cd/m2, max: 1000.0000 cd/m2
Maximum Content Light Level : 1000 cd/m2
Maximum Frame-Average Light Level : 400 cd/m2
So far so good.
Here comes the tricky part.
While the player is talking, the interviewer is gonna show some footages of his old games. Some of them are old XDCAM50 in BT709 and some other were old BetaCAM that I had to acquire from scratch. My target file is PQ, in other words BT2020 HDR10 and the specs must match the ones of the HDR file provided, which means that I gotta:
1) Deinterlace
tdeint(mode=2, order=-1, field=-1, mthreshL=6, mthreshC=6, map=0, type=2, debug=false, mtnmode=1, sharp=true, cthresh=6, blockx=16, blocky=16, chroma=true, MI=64, tryWeave=true, link=1, denoise=true, slow=2, opt=4)
2) Upscale to 3840x2160
nnedi3_resize16(target_width=1920, target_height=1080, mixed=true, thr=1.0, elast=1.5, nns=4, qual=2, etype=0, pscrn=4, threads=0, tv_range=true, kernel_d="Spline", kernel_u="Spline", taps=6, f_d=1.0, f_u=2.0, sharp=0, lsb_in=true, lsb=true)
3) Deband and convert 16bit stacked to 16bit interleaved
flash3kyuu_deband_f3kdb(range=15, Y=64, Cb=64, Cr=64, grainY=64, grainC=64, sample_mode=2, blur_first=True, dynamic_grain=False, opt=-1, mt=True, dither_algo=3, keep_tv_range=False, input_mode=1, input_depth=16, output_mode=2, output_depth=16)
4) Convert from 16bit interleaved to real 16bit
avs2yuv.exe "H:\AVS Script.avs" -depth 16 -csp auto - |
5) Convert from BT709 to BT2020 with 16bit precision and 4:2:0 to 4:2:0 Type2
ffmpeg.exe -i - -vf lut3d="Custom_LUT_2.cube" -pix_fmt yuv420p16le -f yuv4mpegpipe -strict -1 - | ffmpeg.exe -i - -vf scale=out_color_matrix=bt2020nc:out_h_chr_pos=0:out_v_chr_pos=0 -pix_fmt yuv420p16le -strict -1 -an -f yuv4mpegpipe - | x265.exe --y4m - --dither
6) Convert from BT2020 4:2:0 Type2 SDR to PQ / HDR10
-vf lut3d="Custom_LUT.cube"
(The red part is the one I don't know how to do).
I was thinking about creating a LUT, but I've never done anything like this before... I mean, I never graded an SDR to HDR10 (PQ). Looking for solutions on google I found this site: https://www.mysterybox.us/store/sdr-to-hdr10-conversionsv10 but I would rather not spend 200 bucks for that.
Any thoughts? Thank you in advance.
I have a very particular request.
I've got the raw files of an interview of a famous football player. The interview has been shot in 3840x2160 1.77 FF 10bit BT2020 HDR, 4:2:0 Type 2 with the following specs:
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : SMPTE ST 2084
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : R: x=0.680000 y=0.320000, G: x=0.265000 y=0.690000, B: x=0.150000 y=0.060000, White point: x=0.312700 y=0.329000
Mastering display luminance : min: 0.0000 cd/m2, max: 1000.0000 cd/m2
Maximum Content Light Level : 1000 cd/m2
Maximum Frame-Average Light Level : 400 cd/m2
So far so good.
Here comes the tricky part.
While the player is talking, the interviewer is gonna show some footages of his old games. Some of them are old XDCAM50 in BT709 and some other were old BetaCAM that I had to acquire from scratch. My target file is PQ, in other words BT2020 HDR10 and the specs must match the ones of the HDR file provided, which means that I gotta:
1) Deinterlace
tdeint(mode=2, order=-1, field=-1, mthreshL=6, mthreshC=6, map=0, type=2, debug=false, mtnmode=1, sharp=true, cthresh=6, blockx=16, blocky=16, chroma=true, MI=64, tryWeave=true, link=1, denoise=true, slow=2, opt=4)
2) Upscale to 3840x2160
nnedi3_resize16(target_width=1920, target_height=1080, mixed=true, thr=1.0, elast=1.5, nns=4, qual=2, etype=0, pscrn=4, threads=0, tv_range=true, kernel_d="Spline", kernel_u="Spline", taps=6, f_d=1.0, f_u=2.0, sharp=0, lsb_in=true, lsb=true)
3) Deband and convert 16bit stacked to 16bit interleaved
flash3kyuu_deband_f3kdb(range=15, Y=64, Cb=64, Cr=64, grainY=64, grainC=64, sample_mode=2, blur_first=True, dynamic_grain=False, opt=-1, mt=True, dither_algo=3, keep_tv_range=False, input_mode=1, input_depth=16, output_mode=2, output_depth=16)
4) Convert from 16bit interleaved to real 16bit
avs2yuv.exe "H:\AVS Script.avs" -depth 16 -csp auto - |
5) Convert from BT709 to BT2020 with 16bit precision and 4:2:0 to 4:2:0 Type2
ffmpeg.exe -i - -vf lut3d="Custom_LUT_2.cube" -pix_fmt yuv420p16le -f yuv4mpegpipe -strict -1 - | ffmpeg.exe -i - -vf scale=out_color_matrix=bt2020nc:out_h_chr_pos=0:out_v_chr_pos=0 -pix_fmt yuv420p16le -strict -1 -an -f yuv4mpegpipe - | x265.exe --y4m - --dither
6) Convert from BT2020 4:2:0 Type2 SDR to PQ / HDR10
-vf lut3d="Custom_LUT.cube"
(The red part is the one I don't know how to do).
I was thinking about creating a LUT, but I've never done anything like this before... I mean, I never graded an SDR to HDR10 (PQ). Looking for solutions on google I found this site: https://www.mysterybox.us/store/sdr-to-hdr10-conversionsv10 but I would rather not spend 200 bucks for that.
Any thoughts? Thank you in advance.