Skip to content

Commit 6309bcb

Browse files
committed
同步与整合上游
核心: 同步 --slang --alang --subs-fallback --hwdec 脚本: uosc 同步至 4.7.0+ ;撤回临时修复,使用上游方案代替 着色器: nlmeans再次经历了重构,只采用原始仓库标准和hqx目录中的着色器并移除微调式(关联如下)的变体 - guided guided_fast - guided_s guided_s_fast - nlmeans nlmeans_sharpen_denoise nlmeans_sharpen_only - nlmeans_temporal nlmeans_temporal_sharpen_denoise
1 parent ccb8432 commit 6309bcb

File tree

19 files changed

+5616
-4817
lines changed

19 files changed

+5616
-4817
lines changed

portable_config/mpv.conf

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
d3d11-exclusive-fs = no # [当 --gpu-api=d3d11 时] 全屏时独占,默认 no
2222
d3d11-flip = yes # (通常在 --d3d11-exclusive-fs=yes 和 --on-top 一起使用时)禁用它可避免MPV全屏时的冻屏问题,默认 yes
2323

24-
hwdec = no # 指定应使用的硬件视频解码API,默认软解(no)。10系以上N卡如需硬解强烈建议使用 nvdec-copy
25-
# 值 auto 等效 yes 即原生硬解。追求效率可使用,但不支持部分设置/滤镜/着色器
26-
# 平衡选择推荐使用 auto-copy
24+
hwdec = no # 指定应使用的硬件视频解码API,默认值 no 为软解。值 auto 等效 yes 即原生硬解,但不支持部分设置/滤镜。
25+
# 它也可以是多个值组成的优先级列表,例如值 vulkan-copy,nvdec-copy,dxva2-copy 表示依次尝试这些解码模式
26+
# 更多详情参见Wiki的FAQ页面下的“软硬解的选择”部分
2727
hwdec-codecs = "h264,vc1,hevc,vp8,vp9,av1,prores"
2828
# 对限定范围内的编码尝试硬解,特殊值 all 即任意格式都尝试硬解,当前版本默认值 h264,vc1,hevc,vp8,vp9,av1,prores
2929
vd-lavc-dr = auto # <默认auto|yes|no> 是否直接解码到显存,个别低端英特尔处理器可能需要显式禁用此功能以大幅提速解码
@@ -139,7 +139,8 @@
139139
# 特殊值 stereo 强制多声道音源下混为双声道输出(避免可能的7.1/5.1→2.0声音丢失和音量过小)
140140
audio-pitch-correction = yes # 变速播放时的音调修正,默认 yes
141141
alang =
142-
# 音轨首选语言,但MPV优先加载外挂轨道,此项参数可能实际用处不大。默认为空,例值(优选中文) chs,sc,zh,chi,zho
142+
# 音轨首选语言,但MPV优先加载外挂轨道,此项参数可能实际用处不大。
143+
# 默认为空,特殊值可为 auto (尝试匹配系统语言),例值(优选中文) chs,sc,zh,chi,zho
143144
audio-file-auto = no # <默认no|exact|fuzzy|all> 自动加载同名外挂音轨(fuzzy为模糊名,exact为精确名)
144145

145146

@@ -252,8 +253,10 @@
252253
sub-file-paths =
253254
# 在指定的额外目录中寻找匹配的字幕。支持相对和绝对路径,默认为空
254255
# 例值( sub;subtitles;字幕;C:/字幕库 )即自动搜索当前文件路径下名为"sub","subtitles","字幕"和C盘的"字幕库"文件夹内
255-
slang =
256-
# 字幕首选语言,但MPV优先加载外挂轨道,此项参数可能实际用处不大。默认为空,例值(优选中文) chs,sc,zh,chi,zho
256+
slang = auto
257+
# 字幕首选语言,但MPV优先加载外挂轨道,此项参数可能实际用处不大。
258+
# 默认值为 auto (尝试匹配系统语言),例值(优选中文) chs,sc,zh,chi,zho
259+
subs-fallback = no # <yes|default|默认no> 现有字幕轨无法满足 --slang 的条件时是否回退选择其它字幕,值 default 表示仅选择带有“默认”标记的轨道
257260
blend-subtitles = no # <yes|video|默认no> 在插值和颜色管理之前,将字幕混合到视频帧上。值video类似于yes,但是以视频的原始分辨率绘制字幕,并与视频一起缩放
258261
# 启用此功能会将字幕限制在视频的可见部分(不能出现在视频下方的黑色空白处)
259262
# 还会让字幕受 --icc-profile --target-prim --target-trc --interpolation --gamma-factor --glsl-shaders 的影响

portable_config/scripts/osc_plus.lua

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--[[
22
SOURCE_ https://github.com/mpv-player/mpv/blob/master/player/lua/osc.lua
3-
COMMIT_ b7ffe0d16eec8153d9609382997baaf6a29e5e4f
3+
COMMIT_ 945d7c1eda47c97c4bfba884fb21f398a64b2289
44
文档_ https://github.com/hooke007/MPV_lazy/discussions/18
55
66
改进版本的OSC,不兼容其它OSC类脚本(实现全部功能需搭配 新缩略图引擎 thumbfast )
@@ -1432,6 +1432,11 @@ layouts["box"] = function ()
14321432
{x = posX - pos_offsetX, y = bigbtnrowY, an = 7, w = 70, h = 18}
14331433
lo.style = osc_styles.smallButtonsL
14341434

1435+
lo = add_layout("tog_forced_only")
1436+
lo.geometry =
1437+
{x = posX - pos_offsetX + 70, y = bigbtnrowY - 1, an = 7, w = 25, h = 18}
1438+
lo.style = osc_styles.smallButtonsL
1439+
14351440
lo = add_layout("tog_fs")
14361441
lo.geometry =
14371442
{x = posX+pos_offsetX - 25, y = bigbtnrowY, an = 4, w = 25, h = 25}
@@ -1941,6 +1946,12 @@ function bar_layout(direction)
19411946
lo.geometry = geo
19421947
lo.style = osc_styles.smallButtonsBar
19431948

1949+
-- Forced-subs-only button
1950+
geo = { x = geo.x - geo.w - padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
1951+
lo = add_layout("tog_forced_only")
1952+
lo.geometry = geo
1953+
lo.style = osc_styles.smallButtonsBar
1954+
19441955
-- Track selection buttons
19451956
geo = { x = geo.x - tsW - padX, y = geo.y, an = geo.an, w = tsW, h = geo.h }
19461957
lo = add_layout("cy_sub")
@@ -2327,6 +2338,32 @@ function osc_init()
23272338
ne.eventresponder["shift+mbtn_left_down"] =
23282339
function () show_message(get_tracklist("sub"), 2) end
23292340

2341+
-- tog_forced_only
2342+
local tog_forced_only = new_element("tog_forced_only", "button")
2343+
2344+
ne = tog_forced_only
2345+
ne.content = function ()
2346+
sub_codec = mp.get_property("current-tracks/sub/codec")
2347+
if (sub_codec ~= "dvd_subtitle" and sub_codec ~= "hdmv_pgs_subtitle") then
2348+
return ""
2349+
end
2350+
local base_a = tog_forced_only.layout.alpha
2351+
local alpha = base_a[1]
2352+
if not mp.get_property_bool("sub-forced-only-cur") then
2353+
alpha = 255
2354+
end
2355+
local ret = assdraw.ass_new()
2356+
ret:append("[")
2357+
ass_append_alpha(ret, {[1] = alpha, [2] = 1, [3] = base_a[3], [4] = base_a[4]}, 0)
2358+
ret:append("F")
2359+
ass_append_alpha(ret, base_a, 0)
2360+
ret:append("]")
2361+
return ret.text
2362+
end
2363+
ne.eventresponder["mbtn_left_up"] = function ()
2364+
mp.set_property_bool("sub-forced-only", (not mp.get_property_bool("sub-forced-only-cur")))
2365+
end
2366+
23302367
ne.eventresponder["wheel_up_press"] =
23312368
function () set_track("sub", -1) end
23322369
ne.eventresponder["wheel_down_press"] =

portable_config/scripts/thumbfast.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--[[
22
SOURCE_ https://github.com/po5/thumbfast/blob/master/thumbfast.lua
3-
COMMIT_ 8aa6faf10adad899e05cc9b850cde904d37515be
3+
COMMIT_ 4241c7daa444d3859b51b65a39d30e922adb87e9
44
55
适配多个OSC类脚本的新缩略图引擎
66
@@ -260,8 +260,8 @@ local auto_run = options.auto_run
260260

261261
local function info(w, h)
262262
local short_video = mp.get_property_number("duration", 0) <= options.min_duration
263-
local image = properties["current-tracks"] and properties["current-tracks"]["video"] and properties["current-tracks"]["video"]["image"]
264-
local albumart = image and properties["current-tracks"]["video"]["albumart"]
263+
local image = properties["current-tracks/video"] and properties["current-tracks/video"]["image"]
264+
local albumart = image and properties["current-tracks/video"]["albumart"]
265265

266266
disabled = (w or 0) == 0 or (h or 0) == 0 or
267267
has_vid == 0 or
@@ -692,8 +692,7 @@ local function update_tracklist(name, value)
692692
-- current-tracks shim
693693
for _, track in ipairs(value) do
694694
if track.type == "video" and track.selected then
695-
properties["current-tracks/video/image"] = track.image
696-
properties["current-tracks/video/albumart"] = track.albumart
695+
properties["current-tracks/video"] = track
697696
return
698697
end
699698
end
@@ -748,7 +747,7 @@ local function shutdown()
748747
end
749748
end
750749

751-
mp.observe_property("current-tracks", "native", function(name, value)
750+
mp.observe_property("current-tracks/video", "native", function(name, value)
752751
update_property(name, value)
753752
end)
754753

portable_config/scripts/uosc/elements/Elements.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Elements:remove(idOrElement)
2222
if element then
2323
if not element.destroyed then element:destroy() end
2424
element.enabled = false
25-
self.itable = itable_remove(self.itable, self[id])
25+
self.itable = itable_delete_value(self.itable, self[id])
2626
self[id] = nil
2727
request_render()
2828
end

0 commit comments

Comments
 (0)