From aace3e4cdeb52d47455796892ff29363b3586af3 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 13 Jul 2016 11:29:31 +0200 Subject: 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) --- player/lua/stats.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'player/lua') diff --git a/player/lua/stats.lua b/player/lua/stats.lua index 4cb7be12ce..f8afc0806d 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -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 -- cgit v1.2.3