MediaInfoLib icon indicating copy to clipboard operation
MediaInfoLib copied to clipboard

MasteringDisplay_Luminance parameter different on Linux and Windows machines

Open NikinV opened this issue 6 years ago • 12 comments

MasteringDisplay_Luminance parameter different on Linux and Windows machines

Machines configuration: Linux: Debian 9 (x64 - VirtualBox machine) Windows: 7 (x64) Processor: Intel Core i3-3220 RAM: 16 GB

File: http://uhdsample.com/9-sony-swordsmith-hdr-60-fps-demo-trailer.html

Linux value: "Mastering display luminance: min: 0.1000 cd/m2, max: 0 cd/m2" Windows value: "MasteringDisplay_Luminance: min: 0.1000 cd/m2, max: 1 cd/m2"

MediaInfo version: 19.04 (x64) Linux: https://mediaarea.net/en/MediaInfo/Download/AppImage Windows: https://mediaarea.net/en/MediaInfo/Download/Windows

NikinV avatar Apr 26 '19 12:04 NikinV

The HDR metadata in this file is really buggy! But not a reason for different output.

JeromeMartinez avatar Apr 26 '19 16:04 JeromeMartinez

Meta.Luminance[1] = 5000 Linux: Ztring::ToZtring(((float64)Meta.Luminance[1]) / 10000, 0); = 0

Windows: Ztring::ToZtring(((float64)Meta.Luminance[1]) / 10000, 0); = 1

изображение

pavel-pimenov avatar Apr 27 '19 15:04 pavel-pimenov

@JeromeMartinez when you plan fix this issue?

NikinV avatar Apr 29 '19 11:04 NikinV

@JeromeMartinez when you plan fix this issue?

There is no guaranteed delay for a fix on free support, it may be anything between tomorrow up and never. If you desire a guaranteed delay for a fix, see support contracts and contact us directly.

JeromeMartinez avatar Apr 30 '19 12:04 JeromeMartinez

@JeromeMartinez when you plan fix this issue?

There is no guaranteed delay for a fix on free support, it may be anything between tomorrow up and never. If you desire a guaranteed delay for a fix, see support contracts and contact us directly.

Can you tell me, what Mastering display luminance value is right for this file?

NikinV avatar May 06 '19 06:05 NikinV

Can you tell me, what Mastering display luminance value is right for this file?

Linux version is obviously wrong as max is lower than min ;-). More exactly, it is a rounding issue + issue with not displaying enough precision, max having not digit after comma. The right value is "max 0.5000 cd/m2".

JeromeMartinez avatar May 06 '19 06:05 JeromeMartinez

Can you tell me, what Mastering display luminance value is right for this file?

Linux version is obviously wrong as max is lower than min ;-). More exactly, it is a rounding issue + issue with not displaying enough precision, max having not digit after comma. The right value is "max 0.5000 cd/m2".

Thank you very much

NikinV avatar May 06 '19 06:05 NikinV

Meta.Luminance[1] = 5000 Linux: Ztring::ToZtring(((float64)Meta.Luminance[1]) / 10000, 0); = 0

Windows: Ztring::ToZtring(((float64)Meta.Luminance[1]) / 10000, 0); = 1

изображение

@pavel-pimenov, could you tell me what does that condition (Meta.Luminance[1]-((int)Meta.Luminance[1])==0)?0:4? Why precesion may be zero?

https://github.com/MediaArea/MediaInfoLib/blob/38e2520e6f161edb7f1f1945aa7d7bdd4707b0d1/Source/MediaInfo/File__Analyze_Streams.cpp#L150

NikinV avatar May 06 '19 09:05 NikinV

Why precesion may be zero?

What does it mean why? Because you usually need 0 precision after decimal point if there are no digits after decimal point. @JeromeMartinez is not (Meta.Luminance[1]-((int)Meta.Luminance[1])==0)?0:4 always true? Just change to just 4. Because consider 1000.1000 value, it will be printed not as 1000.1, so no point. You can of course do % 10, % 100, % 1000, % 10000, but why? We are not a math app. Also 0.0000 has no meaning.

Interesting, https://github.com/MediaArea/MediaInfoLib/blob/fafb087ed80f37ed370b503ee30254cd65f21317/Source/MediaInfo/File__Analyze_MinimizeSize.h#L781

ValZapod avatar Nov 19 '20 01:11 ValZapod

I reopen the issue because the precision issue is fixed but not the rounding issue (definitely need to replace all the ugly rounding related code).

JeromeMartinez avatar Feb 11 '21 11:02 JeromeMartinez

You should also add something to fix this: https://github.com/justdan96/tsMuxer/issues/313#issuecomment-659791664

Mastering display luminance : min: 322415.4473 cd/m2, max: 397427 cd/m2

What??????? P.S. See how max is rounded also, BTW ;) That is now fixed. D:)

ValZapod avatar Feb 11 '21 12:02 ValZapod

What???????

Apparently that is MDCV in SEI of AVC. That was implemented recently. Totally forgot. https://code.videolan.org/videolan/x264/-/merge_requests/5

ValZapod avatar Sep 14 '21 23:09 ValZapod