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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
16th June 2018, 21:32 | #1 | Link |
Registered User
Join Date: Jun 2009
Posts: 49
|
Convert HEVC 2160p 10 bits HLG to 2160p 8bits with HLG/HDR using ffmpeg
I have this World Cup sample in 4k HEVC 4:2:0 HLG 10bits and i want to convert it to 4k HEVC 8bits HLG/HDR using ffmpeg but maintaining the correct colors
https://transfer.pcloud.com/download...3TCb5VnyMDbagV I tried this that i found on another site, but the color results are horrible ffmpeg -i "d:\Descargas\NPO1 UHD.ts" -c:a copy -c:v libx265 -tag:v hvc1 -crf 22 -pix_fmt yuv420p10le -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc" "d:\Descargas\NPO1_UHD_mkv.mkv" Any help is appreciated... |
16th June 2018, 22:13 | #3 | Link | |
Registered User
Join Date: Jun 2009
Posts: 49
|
Quote:
ID : 511 (0x1FF) Menu ID : 20901 (0x51A5) Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main 10@L5.1@Main Codec ID : 36 Duration : 53 s 280 ms Bit rate : 24.4 Mb/s Width : 3 840 pixels Height : 2 160 pixels Display aspect ratio : 16:9 Frame rate : 50.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 10 bits Bits/(Pixel*Frame) : 0.059 Stream size : 155 MiB (93%) Encryption : TPS-Crypt or Viaccess Color range : Limited Color primaries : BT.2020 Transfer characteristics : HLG / BT.2020 (10-bit) Matrix coefficients : BT.2020 non-constant |
|
16th June 2018, 22:57 | #4 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Assuming that is MediaInfo output, I'll have to look into how it detects HLG (there is no metadata for HLG). It may just be 2020 UHD, as the "HLG / BT.2020" could be ambiguous with the "/" meaning "or" rather than "and". If I decode this as simple UHD, then it looks fine. Investigating...
|
16th June 2018, 23:11 | #5 | Link | |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,368
|
Quote:
HLG-encoded streams usually have one extra SEI message that tells the player that the stream is HLG, but if you ignore that SEI message then it would just look like ordinary BT.2020 SDR. For the OP, you should definitely not set the transfer to 2084 since thats not HLG but HDR10/PQ. I don't know if x265 can properly set the double transfer characteristics that HLG uses (ie. BT.2020 in main header, HLG in SEI header).
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
|
16th June 2018, 23:27 | #6 | Link | |
Registered User
Join Date: Jun 2009
Posts: 49
|
Quote:
|
|
19th June 2018, 20:58 | #8 | Link | |
Registered User
Join Date: May 2004
Posts: 324
|
Quote:
I'm a little fuzzy when it comes to HLG, shouldn't the transfer be something other then BT.2020? HDR10 uses ST.2084, I would think HLG uses ARIB STD-B67. |
|
17th June 2018, 17:29 | #9 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 339
|
Quote:
With that said, I cant see any reason for the 8bit transcode, that is out of the HLG specc. What should be done is to convert it to SDR, then transcode it. Last edited by excellentswordfight; 17th June 2018 at 17:38. |
|
17th June 2018, 18:19 | #10 | Link | |
Registered User
Join Date: Jun 2009
Posts: 49
|
Quote:
|
|
17th June 2018, 20:09 | #11 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 339
|
Quote:
When I looked at this the last time the options were limited and I ended up doing it with ffmpeg and a LUT with acceptable results (but definitely not great). Cant share the LUT though so cant help you with that unfortunately. Maybe someone else here know of another solution. I've seen some people doing the convert with just ffmpeg (without a lut), I guess that it would look something like this: Code:
"ffmpeg.exe" -i "input.ts" -vf zscale=tin=arib-std-b67:min=bt2020nc:pin=bt2020:rin=tv:t=arib-std-b67:m=bt2020nc:p=bt2020:r=tv,zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -an -c:v libx265 -preset slow -x265-params level=51:crf=22:keyint=500:min-keyint=50:rc-lookahead=50:bframes=8:no-sao=1:colorprim="bt709":transfer="bt709":colormatrix="bt709":range="limited" "out" Last edited by excellentswordfight; 17th June 2018 at 20:37. |
|
19th June 2018, 22:36 | #12 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,368
|
HLG uses a separate SEI element to indicate a secondary transfer function, which allows fallback to SDR with non-HLG aware players. So the main transfer function entry would be an SDR one, and the extra SEI element would indicate the HLG transfer. If your analyzer does not understand that separate SEI, then it would show as SDR.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
26th June 2018, 04:44 | #15 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,866
|
Quote:
HLG is something that works in practice (decent HDR on supported devices, with decent SDR on legacy devices) but not in theory (same set of code values without metadata can deliver two different creative intents). The challenge with HLG is that it gets optimized for SDR, HDR, or sort of in the middle. It's never going to be as accurate or "HDR" as well-graded HDR-10(+) or Dolby Vision. But if you are a broadcaster limited by RF instead of IP, having one channel that can do SDR and HDR is very appealing. |
|
20th June 2018, 16:23 | #17 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
You're welcome, hydra3333. I am also adding HLG support to DGHDRtoSDR. Current version (no HLG yet) is here:
http://rationalqm.us/misc/DGHDRtoSDR_1.4.rar |
20th June 2018, 21:55 | #18 | Link | |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,248
|
Quote:
Out of interest... Are you viewing HLG content on a screen that supports HLG decoding?
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
Last edited by SeeMoreDigital; 20th June 2018 at 22:01. |
|
22nd June 2018, 07:10 | #19 | Link | |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
don't know if this is relevant, someone said
https://mrmc.tv/forum/viewtopic.php?t=3973#p16210 Quote:
|
|
Tags |
10bits, 2160p, hevc |
Thread Tools | Search this Thread |
Display Modes | |
|
|