summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-09-01 04:12:52 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-10-14 12:30:46 +0200
commit31ba5cd6dfc4803a02908d35f464e2c1c0d14de9 (patch)
tree7a6649947f95e8fffa0537b89e64d1afa5291b57
parent6ff165f4a432845f8cb889ed3209f2d7d88614ca (diff)
downloadmpv-31ba5cd6dfc4803a02908d35f464e2c1c0d14de9.tar.bz2
mpv-31ba5cd6dfc4803a02908d35f464e2c1c0d14de9.tar.xz
stats.lua: add frame info
-rw-r--r--player/lua/stats.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index a1935cf21e..892b85a6f2 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -29,6 +29,7 @@ local o = {
persistent_overlay = false, -- whether the stats can be overwritten by other output
print_perfdata_passes = false, -- when true, print the full information about all passes
filter_params_max_length = 100, -- a filter list longer than this many characters will be shown one filter per line instead
+ show_frame_info = false, -- whether to show the current frame info
debug = false,
-- Graph options and style
@@ -920,6 +921,28 @@ local function add_video(s)
indent=o.prefix_sep .. o.prefix_sep,
no_prefix_markup=false, suffix=""}, {no=true, [""]=true})
end
+ local has_prefix = false
+ if o.show_frame_info then
+ if append_property(s, "estimated-frame-number", {prefix="Frame:"}) then
+ append_property(s, "estimated-frame-count", {indent=" / ", nl="",
+ prefix_sep=""})
+ has_prefix = true
+ end
+ local frame_info = mp.get_property_native("video-frame-info")
+ if frame_info and frame_info["picture-type"] then
+ local attrs = has_prefix and {prefix="(", suffix=")", indent=" ", nl="",
+ prefix_sep="", no_prefix_markup=true}
+ or {prefix="Picture Type:"}
+ append(s, frame_info["picture-type"], attrs)
+ has_prefix = true
+ end
+ if frame_info and frame_info["interlaced"] then
+ local attrs = has_prefix and {indent=" ", nl="", prefix_sep=""}
+ or {prefix="Picture Type:"}
+ append(s, "Interlaced", attrs)
+ end
+ end
+
append_fps(s, "container-fps", "estimated-vf-fps")
append_img_params(s, r, ro)