Skip to content

Commit

Permalink
脚本: stats_plus 修正比例因子的显示
Browse files Browse the repository at this point in the history
修改原始的输出覆盖值
补充多个观测值的显示
  • Loading branch information
hooke007 committed Apr 3, 2023
1 parent acd7743 commit 20a5f55
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
10 changes: 10 additions & 0 deletions portable_config/script-opts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,16 @@



##################
# 增强版控制界面 #
##################

## 更多的其它原版STATS可用的选项及注释见上方原版stats处,如有需求自行添加,这里不全部列出

script-opts-append = stats_plus-persistent_overlay=yes # 此版的默认值为 yes



################
# 新缩略图引擎 #
################
Expand Down
6 changes: 6 additions & 0 deletions portable_config/script-opts/stats_plus.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###不支持参数后注释,须另起一行
###不允许选项和值之间存在多余的空格
## 更多的其它原版STATS可用的选项亦受支持,如有需求自行添加,这里不全部列出 参见 stats.conf

persistent_overlay=yes
##禁止其它OSD文本覆盖stats信息,默认yes(原版为no)
21 changes: 17 additions & 4 deletions portable_config/scripts/stats_plus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ local o = {
duration = 4,
redraw_delay = 1, -- acts as duration in the toggling case
ass_formatting = true,
persistent_overlay = false, -- whether the stats can be overwritten by other output
persistent_overlay = true, -- 是否能被其它输出覆盖(原版默认为否)
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
debug = false,
Expand Down Expand Up @@ -692,6 +692,8 @@ local function add_file(s)
append(s, format("%.1f", demuxer_secs), {prefix="(", suffix=" sec)", nl="",
no_prefix_markup=true, prefix_sep="", indent=o.prefix_sep})
end

append_property(s, "speed", {prefix="播放速度:"})
end


Expand All @@ -711,7 +713,7 @@ local function add_video(s)

append(s, "", {prefix=o.nl .. o.nl .. "视频轨:", nl="", indent=""})
if append_property(s, "video-codec", {prefix_sep="", nl="", indent=""}) then
append_property(s, "hwdec-current", {prefix="硬解API", nl="", indent="",
append_property(s, "hwdec-current", {prefix="硬解 API", nl="", indent="",
no_prefix_markup=true, suffix=""}, {no=true, [""]=true})
end
append_property(s, "avsync", {prefix="音视频同步偏移:"})
Expand Down Expand Up @@ -743,9 +745,20 @@ local function add_video(s)
if append(s, scaled_width, {prefix="缩放分辨率:"}) then
append(s, scaled_height, {prefix="x", nl="", indent=" ", prefix_sep=" ", no_prefix_markup=true})
end
append_property(s, "current-window-scale", {prefix="窗口缩放倍率:"})
if not mp.get_property_native("fullscreen") then
append_property(s, "current-window-scale", {prefix="窗口缩放系数:"})
end
if mp.get_property_native("keepaspect") and mp.get_property_number("video-zoom") ~= 0 then
append_property(s, "video-zoom", {prefix="显示缩放补偿:"})
end
if not mp.get_property_native("video-unscaled") and mp.get_property_number("panscan") > 0 then
append_property(s, "panscan", {prefix="裁切缩放偏移:"})
end
if mp.get_property_number("display-hidpi-scale") > 1 then
append_property(s, "display-hidpi-scale", {prefix="HIDPI 系数:"})
end
if r["aspect"] ~= nil then
append(s, format("%.2f", r["aspect"]), {prefix="画面宽高比率"})
append(s, format("%.2f", r["aspect"]), {prefix="宽高比"})
end
append(s, r["pixelformat"], {prefix="像素格式:"})
if r["hw-pixelformat"] ~= nil then
Expand Down

0 comments on commit 20a5f55

Please sign in to comment.