summaryrefslogtreecommitdiffstats
path: root/player/lua/stats.lua
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-08-25 21:30:13 +0200
committersfan5 <sfan5@live.de>2023-08-28 21:14:26 +0200
commitce64b5687b69ed5d5bbdc9576700493fdab6e144 (patch)
tree75da307799d7accb942b6660357752be4b782005 /player/lua/stats.lua
parent42f8c71aa086580a9e68c10d8e1c30d7426f297d (diff)
downloadmpv-ce64b5687b69ed5d5bbdc9576700493fdab6e144.tar.bz2
mpv-ce64b5687b69ed5d5bbdc9576700493fdab6e144.tar.xz
stats.lua: refactor video params display
- Move window scale to scaled resolution line - add deinterlacing display - rename "Gamma" to "Transfer" - reorder to colormatrix/primaries/transfer as commonly used by ffmpeg/ffprobe
Diffstat (limited to 'player/lua/stats.lua')
-rw-r--r--player/lua/stats.lua30
1 files changed, 20 insertions, 10 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index 7515936b58..0accf84f13 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -685,6 +685,11 @@ local function append_resolution(s, r, prefix, w_prop, h_prop)
append(s, r["aspect-name"], {prefix="(", suffix=")", nl="", indent=" ",
prefix_sep="", no_prefix_markup=true})
end
+ if r['s'] then
+ append(s, format("%.2f", r["s"]), {prefix="(", suffix="x)", nl="",
+ indent=" ", prefix_sep="",
+ no_prefix_markup=true})
+ end
end
end
@@ -736,29 +741,34 @@ local function add_video(s)
if ro and (r["w"] ~= ro["dw"] or r["h"] ~= ro["dh"]) then
append_resolution(s, ro, "Output Resolution:", "dw", "dh")
end
- append_resolution(s, {w=scaled_width, h=scaled_height}, "Scaled Resolution:")
+ local scale = nil
if not mp.get_property_native("fullscreen") then
- append_property(s, "current-window-scale", {prefix="Window Scale:"})
+ scale = mp.get_property_native("current-window-scale")
+ end
+ append_resolution(s, {w=scaled_width, h=scaled_height, s=scale}, "Scaled Resolution:")
+
+ if mp.get_property_native("deinterlace") then
+ append_property(s, "deinterlace", {prefix="Deinterlacing:"})
end
+
append(s, r["pixelformat"], {prefix="Pixel Format:"})
if r["hw-pixelformat"] ~= nil then
append(s, r["hw-pixelformat"], {prefix_sep="[", nl="", indent=" ",
suffix="]"})
end
+ append(s, r["colorlevels"], {prefix="Levels:", nl=""})
-- Group these together to save vertical space
- local prim = append(s, r["primaries"], {prefix="Primaries:"})
- local cmat = append(s, r["colormatrix"], {prefix="Colormatrix:", nl=prim and "" or o.nl})
- append(s, r["colorlevels"], {prefix="Levels:", nl=cmat and "" or o.nl})
-
+ append(s, r["colormatrix"], {prefix="Colormatrix:"})
+ append(s, r["primaries"], {prefix="Primaries:", nl=""})
+ append(s, r["gamma"], {prefix="Transfer:", nl=""})
-- Append HDR metadata conditionally (only when present and interesting)
local hdrpeak = r["sig-peak"] or 0
- local hdrinfo = ""
if hdrpeak > 1 then
- hdrinfo = " (HDR peak: " .. format("%.2f", hdrpeak * 203) .. " nits)"
+ append(s, format("%.0f", hdrpeak * 203),
+ {prefix="(HDR peak", suffix=" nits)", nl="",
+ indent=" ", prefix_sep=": ", no_prefix_markup=true})
end
-
- append(s, r["gamma"], {prefix="Gamma:", suffix=hdrinfo})
append_property(s, "packet-video-bitrate", {prefix="Bitrate:", suffix=" kbps"})
append_filters(s, "vf", "Filters:")
end