1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 17:39:38 +00:00

stats: add HDR signal peak information

Added to mpv in commit a14f9249. Simply shown after the gamma curve if
available, since it's semantically attached to it.

Also regroup some of the colorimetry options to make this fit (and for
them to make more sense)
This commit is contained in:
Niklas Haas 2016-07-13 11:29:31 +02:00 committed by wm4
parent 90ecf52a45
commit aace3e4cde

View File

@ -354,11 +354,21 @@ local function add_video(s)
append_property(s, "window-scale", {prefix="Window Scale:"})
append_property(s, "video-params/aspect", {prefix="Aspect Ratio:"})
append_property(s, "video-params/pixelformat", {prefix="Pixel Format:"})
local cmat = append_property(s, "video-params/colormatrix", {prefix="Colormatrix:"})
local prims = append_property(s, "video-params/primaries",
{prefix="Primaries:", nl=cmat and "" or o.nl})
append_property(s, "video-params/gamma", {prefix="Gamma:", nl=prims and "" or o.nl})
append_property(s, "video-params/colorlevels", {prefix="Levels:"})
-- Group these together to save vertical space
local prim = append_property(s, "video-params/primaries", {prefix="Primaries:"})
local cmat = append_property(s, "video-params/colormatrix",
{prefix="Colormatrix:", nl=prim and "" or o.nl})
append_property(s, "video-params/colorlevels", {prefix="Levels:", nl=cmat and "" or o.nl})
-- Append HDR metadata conditionally (only when present and interesting)
local hdrpeak = mp.get_property_number("video-params/sig-peak", 0)
local hdrinfo = ""
if hdrpeak > 0 then
hdrinfo = " (HDR peak: " .. hdrpeak .. " cd/m²)"
end
append_property(s, "video-params/gamma", {prefix="Gamma:", suffix=hdrinfo})
append_property(s, "packet-video-bitrate", {prefix="Bitrate:", suffix=" kbps"})
end