nv_hevc_hdr_patcher icon indicating copy to clipboard operation
nv_hevc_hdr_patcher copied to clipboard

How to specify the Mastering Display Data from a tool such as mediainfo

Open Brainiarc7 opened this issue 7 years ago • 10 comments

Hello there,

I have a file with the following mediainfo, as shown below:

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

How do I convert this into the format string as specified in the readme, i.e G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)?

Brainiarc7 avatar Dec 22 '17 16:12 Brainiarc7

Dont need to convert. Your file has a standard Display Mastering P3 HDR mediainfo, so "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" IS EQUAL TO "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)"

Unfortunately this program does not work properly... IMHO)

drSHLEFF avatar Dec 22 '17 17:12 drSHLEFF

How do you do the math that results in the result? Is there a formula for that?

Brainiarc7 avatar Dec 22 '17 18:12 Brainiarc7

Yes --master-display SMPTE ST 2086 mastering display color volume SEI info, specified as a string which is parsed when the stream header SEI are emitted. The string format is “G(%hu,%hu)B(%hu,%hu)R(%hu,%hu)WP(%hu,%hu)L(%u,%u)” where %hu are unsigned 16bit integers and %u are unsigned 32bit integers. The SEI includes X,Y display primaries for RGB channels and white point (WP) in units of 0.00002 and max,min luminance (L) values in units of 0.0001 candela per meter square. Applicable for HDR content.

Example for a P3D65 1000-nits monitor, where G(x=0.265, y=0.690), B(x=0.150, y=0.060), R(x=0.680, y=0.320), WP(x=0.3127, y=0.3290), L(max=1000, min=0.0001):

G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1) Note that this string value will need to be escaped or quoted to protect against shell expansion on many platforms. No default.

--max-cll Maximum content light level (MaxCLL) and maximum frame average light level (MaxFALL) as required by the Consumer Electronics Association 861.3 specification.

Specified as a string which is parsed when the stream header SEI are emitted. The string format is “%hu,%hu” where %hu are unsigned 16bit integers. The first value is the max content light level (or 0 if no maximum is indicated), the second value is the maximum picture average light level (or 0). Applicable for HDR content.

Example for MaxCLL=1000 candela per square meter, MaxFALL=400 candela per square meter:

–max-cll ?1000,400? Note that this string value will need to be escaped or quoted to protect against shell expansion on many platforms. No default.

http://x265.readthedocs.io/en/default/cli.html

drSHLEFF avatar Dec 22 '17 18:12 drSHLEFF

By any chance, is there a Linux equivalent to this utility?

It'd be awesome if NVENC had support for HDR out of the box.

Brainiarc7 avatar Dec 22 '17 18:12 Brainiarc7

On Linux you could simply use the python script,..

Selur avatar Dec 22 '17 18:12 Selur

Yes, very simple) Don't know, I don't like Linux, and use it only on my home media server...

drSHLEFF avatar Dec 22 '17 18:12 drSHLEFF

Dear nvhsp coder, could you PLEASE help out this guy getting the master-display settings correct for nvencc? This is the link to the site: https://github.com/rigaya/NVEnc/issues/51 The coder of NVEnc has NEARLY finished the complete implementation of everything that was listed in nvhsp as options. However the master display keeps being a problem for him, could you PLEASE help him out by giving some hints on how to do it?

pwacooijmans avatar May 28 '18 16:05 pwacooijmans

DCI-P3: --master-display G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1) --max-cll 1000,1 RGB: G(x=0.265, y=0.690), B(x=0.150, y=0.060), R(x=0.680, y=0.320), WP(x=0.3127, y=0.329), L(max=1000, min=0.0000)

Rec.709: --master-display G(15000,30000)B(7500,3000)R(32000,16500)WP(15635,16450)L(10000000,1) --max-cll 1000,1 RGB: G(x=0.30, y=0.60), B(x=0.150, y=0.060), R(x=0.640, y=0.330), WP(x=0.3127,y=0.329), L(max=1000, min=0.0000)

Rec.2020: --master-display G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,1) --max-cll 1000,1 RGB: G(x=0.170, y=0.797), B(x=0.131, y=0.046), R(x=0.708, y=0.292), WP(x=0.3127,y=0.329), L(max=1000, min=0.0000)

To convert, simply divide the RGB values by 0.00002 Sample for "Display P3": 0.265 / 0.00002 = 13250 0.69 / 0.00002 = 34500 0.15 / 0.00002 = 7500 0.06 / 0.00002 = 3000 0.68 / 0.00002 = 34000 0.32 / 0.00002 = 16000 0.3127 / 0.00002 = 15635 0.329 / 0.00002 = 16450

Information: https://en.wikipedia.org/wiki/DCI-P3 https://en.wikipedia.org/wiki/Rec._709 https://en.wikipedia.org/wiki/Rec._2020

https://www.smpte.org/sites/default/files/section-files/HDR.pdf

drSHLEFF avatar May 28 '18 17:05 drSHLEFF

Hello there,

I have a file with the following mediainfo, as shown below:

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

How do I convert this into the format string as specified in the readme, i.e G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)?

How do you get that data from Mediainfo?

tazlord avatar Jan 29 '20 05:01 tazlord

x50000 and x10000

Op wo 29 jan. 2020 06:01 schreef David Sanchez [email protected]:

Hello there,

I have a file with the following mediainfo, as shown below:

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

How do I convert this into the format string as specified in the readme, i.e G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)?

How do you get that data from Mediainfo?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SK-Hardwired/nv_hevc_hdr_patcher/issues/9?email_source=notifications&email_token=AHK7SNFD4BJ4RILXE2FEHVLRAEETLA5CNFSM4EJM6CAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKF6KAQ#issuecomment-579593474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHK7SNCFYHK6C6QXP4GEFN3RAEETLANCNFSM4EJM6CAA .

pwacooijmans avatar Jan 29 '20 11:01 pwacooijmans