diff options
author | Niklas Haas <git@nand.wakku.to> | 2016-07-13 11:29:31 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-10-09 20:40:31 +0200 |
commit | aace3e4cdeb52d47455796892ff29363b3586af3 (patch) | |
tree | 12b103a4c261debfcfeacc58747121f73e3bcec6 | |
parent | 90ecf52a454e48280e58b743db49b863813ec7f5 (diff) | |
download | mpv-aace3e4cdeb52d47455796892ff29363b3586af3.tar.bz2 mpv-aace3e4cdeb52d47455796892ff29363b3586af3.tar.xz |
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)
-rw-r--r-- | player/lua/stats.lua | 20 |
1 files changed, 15 insertions, 5 deletions
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 |