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. |
7th October 2015, 20:07 | #1 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
Encoding 4K HDR 4:2:0 10bit BT.2020
I would like to make a test encoding to 4K, HDR, 4:2:0, 10bit, BT.2020, something like I found here (these are playing back properly on my TV), but if I use this line, then I get a video with strange yellowish, bluish colors:
Code:
avs4x26x-x64.exe -L "F:\x265\Win64_16bpp\x265.exe" --seek-mode safe --preset slow --subme 7 --no-open-gop --crf 17 --profile main10 --level-idc 5.1 --colorprim bt2020 --colormatrix bt2020nc --input-depth 8 --output "D:\encoding\x265_4k_420_10bit_bt2020.hevc" "signpost.avs" pause or where is the problem? I know, that I have 8bit input source, but this is just experimenting. Last edited by surami; 14th October 2015 at 11:41. |
7th October 2015, 20:41 | #2 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
|
I assume your source is not really BT.2020? You need to convert the gamut to bt.2020 if you want the colors to be correct. The --colorprim and --colormatrix options set the information but do not covert. You are probably viewing BT.709 gamut video as if it was BT.2020 video so the colors are wrong.
I don't believe Avisynth's normal convert handles BT.2020 but Dither tools does. This should work: Dither_convert_yuv_to_rgb(matrix="709") Dither_convert_rgb_to_yuv(matrix="2020")
__________________
madVR options explained |
7th October 2015, 22:44 | #3 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
The main source is a RGB24 AVI file made by the Advanced FrameServer in After Effects.
In the AVS I have this: Code:
AVISource("D:\rendering\signpost.avi", audio=false).AssumeFPS(25,1) ConvertToYV12(matrix="Rec709") Dither_convert_yuv_to_rgb(matrix="709") Dither_convert_rgb_to_yuv(matrix="2020") If I play those HDR files on my PC, the colors are wrong, they look like the mentioned problem with my x265 files on the TV, but if I play those files on TV, the colors are fine. Last edited by surami; 7th October 2015 at 22:52. |
7th October 2015, 23:05 | #4 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
|
If you are already RGB all you need is:
Code:
AVISource("D:\rendering\signpost.avi", audio=false).AssumeFPS(25,1) Dither_convert_rgb_to_yuv(matrix="2020") I wouldn't expect you to need any other flags set for your TV to understand BT.2020 but I am not sure.
__________________
madVR options explained |
8th October 2015, 10:26 | #5 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
I'm using MPC-HC without madVR on my PC. In the morning I tried with madVR too, but there wasn't any difference.
I think there are some other flags that is necessary, because those HDR videos are runing fine on the USB port of the TV (Samsung UE40JU6000). |
8th October 2015, 13:30 | #7 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
I did that, the video from the hdrsample.com is using BT.2020, but MediaInfo shows this info too.
The playback with clean MPC-HC install or using madVR renderer doesn't make any difference in colors. I forgot to mention, that I also run my hevc file through MP4Box with the following command: Code:
mp4box -add "output.hevc" -brand hev1 "output.mp4" pause Maybe the TV decoder gets extra info from somewhere or my encoding isn't valid for TV playback, I don't know. Last edited by surami; 15th October 2015 at 20:06. |
8th October 2015, 15:40 | #8 | Link |
Registered User
Join Date: Jul 2015
Posts: 706
|
I also make mistakes, but maybe something like this:
Code:
ffmpeg.exe -s 3840x2160 -r 25.000 -i "import.mp4" -an -sn -f rawvideo -pix_fmt yuv420p10le - | x264.10bpp.exe --demuxer raw --threads 4 --input-depth 10 --input-csp i420 --input-res 3840x2160 --output-csp i420 --keyint 25 --min-keyint 1 --bitrate 40000 --vbv-bufsize 120000 --vbv-maxrate 120000 --open-gop --fps 25.000 --preset veryslow --tune stillimage --range tv --colormatrix bt2020nc --colorprim bt2020 --transfer bt2020-10 - --output "output_x264.h264" x265.10bpp.exe --input-depth 10 --input-csp i420 --input-res 3840x2160 --output-depth 10 --keyint 25 --min-keyint 1 --bitrate 40000 --vbv-bufsize 120000 --vbv-maxrate 120000 --open-gop --fps 25.000 --preset slow --range limited --colormatrix bt2020nc --colorprim bt2020 --transfer bt2020-10 - --output "output_x265.h265" vpxenc.exe -v --threads=4 --bit-depth=10 --input-bit-depth=10 --i420 -w 3840 -h 2160 --kf-max-dist=25 --kf-min-dist=0 --target-bitrate=40000 --drop-frame=0 --fps=25000/1000 --good --profile=3 --codec=vp9 --passes=1 --pass=1 --cpu-used=3 --color-space=bt2020 --aq-mode=1 - -o "vp90_422p10le.webm" ffmpeg.exe -s 3840x2160 -r 25.000 -i "output_x264/x265.h264/h265" -i audio.aac -i subtitle.srt -f mp4 -c copy -movflags faststart -pix_fmt yuv420p10le "output.mp4" Last edited by Jamaika; 8th October 2015 at 16:29. |
8th October 2015, 17:33 | #9 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
I found an interesting discussion about HDR from #4174, so I thought right, we need --master-display and --transfer commands too.
Last edited by surami; 8th October 2015 at 17:49. |
8th October 2015, 22:36 | #10 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 4,926
|
I see no strange colors or do you mean by that the Dynamic Range representation of the output result on the Target 10 bit ? Monitor itself ?
10->8bit
__________________
all my compares are riddles so please try to decipher them yourselves :) It is about Time Join the Revolution NOW before it is to Late ! http://forum.doom9.org/showthread.php?t=168004 Last edited by CruNcher; 8th October 2015 at 23:03. |
8th October 2015, 23:13 | #11 | Link | ||
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
Quote:
Quote:
Last edited by surami; 8th October 2015 at 23:20. |
||
8th October 2015, 23:31 | #12 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 4,926
|
Interesting they gain some dynamics with Samsungs Magic Bright Cinema Preset
Very big difference though unusable for Desktop usage (kills the eyes) http://www.samsung.com/sg/support/skp/htg/17189 biggest impact i see especially on the skin representation Sharper ,Colder and more Contrast is how it looks Wow i could further improve the output result these samples are perfect for tweaking
__________________
all my compares are riddles so please try to decipher them yourselves :) It is about Time Join the Revolution NOW before it is to Late ! http://forum.doom9.org/showthread.php?t=168004 Last edited by CruNcher; 9th October 2015 at 00:23. |
9th October 2015, 10:42 | #14 | Link | |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
Quote:
|
|
9th October 2015, 11:42 | #15 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
Well I think it understands BT.2020, because the downloadable HDR samples are playing fine on my TV.
Update: Ohh I'm starting to get something in my head? If the TV understands BT.2020 then it plays the video as HDR and if it doesn't understands it plays as BT.709 LDR or how is this? I found info about the HDR video provided by the FOX. Last edited by surami; 9th October 2015 at 12:19. |
9th October 2015, 17:45 | #17 | Link | |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
|
Quote:
Dither_convert_rgb_to_yuv(matrix="2020") There may be something else for HDR than simply using the BT.2020 matrix?
__________________
madVR options explained |
|
9th October 2015, 17:52 | #18 | Link |
Registered User
Join Date: Jul 2015
Posts: 706
|
This is due to two variants standards High Dynamic Range UltraBluray. The above I described unknowingly SDR. The problem is that how many standards HDR. Is for any brand of TV is different SMPTE. Is this variant we use the function --range.
http://www.ip.philips.com/data/downl...hite_paper.pdf For Panasonic, I see that it is recommended encoding of the HDR video the ST 2084 EOTF. Last edited by Jamaika; 10th October 2015 at 09:55. |
9th October 2015, 19:15 | #19 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
The "HDR-10" format which is what everyone is using for actual HDR content on real displays uses the PQ Curve (SMPTE 2084) instead of gamma to map luma codes to actual brightness. That uses --transfer 16 smpte-st-2084. Gamma has been baked into our assumptions about video for, what 70 years now? So pretty much no tool has much of an idea for how to handle a polynominal mapping between Y' and actual display brightness. Processing needs to be done in linear light, and even tools like After Effects don't have the ability to export from their internal linear light space to PQ, and I'm told the existing icm/icc file format can't even describe the transform adequately. Very few tools actually support converting to and from that color space today, and nothing that's FOSS I'm aware of. It's more like the colorists use a special display configured to provide that format, and then do a separate color grade based on that. It's not something that is done automatically; instead it as a re-grade from HDR source content, using various RAW-like formats that high-end digital cinema cameras can record. Master-display and max-cll are optional metadata. You'd need to know what nominal display you are doing your conversion to HDR to know what those values are supposed to be, since real TVs don't support 100% of rec2020 (10K nits, huge color gamut). In practice most are targeting 1000 nits and the P3 color space used in digital cinema. It's awesome that you're trying to do this, and I won't try to dissuade you by telling you any more about how incredibly hard it is to do in 2015. I've done more HDR encoding than probably anyone else on the planet, and I wouldn't even know how to start in trying to personally convert and existing consumer HDR image or video to consumer HDR-10. |
|
9th October 2015, 20:16 | #20 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 4,926
|
Interesting this old Samsung PLS Panel can actually drive this in the Samples not bad i never saw the Cinema Preset so expanding the quality on DVD content or stuff before then the impact it has on these Ateme 4K HDR Encoded Film Samples
I would say it's a decent Tone Mapping result also though i don't know the Pro Hardware result you use of course but Samsung Consumer stuff allways fascinates me here once again
__________________
all my compares are riddles so please try to decipher them yourselves :) It is about Time Join the Revolution NOW before it is to Late ! http://forum.doom9.org/showthread.php?t=168004 Last edited by CruNcher; 9th October 2015 at 20:23. |
|
|