Skip to content

Commit

Permalink
同步与整合上游
Browse files Browse the repository at this point in the history
核心:
同步 --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
  • Loading branch information
hooke007 committed Jun 29, 2023
1 parent ccb8432 commit 6309bcb
Show file tree
Hide file tree
Showing 19 changed files with 5,616 additions and 4,817 deletions.
15 changes: 9 additions & 6 deletions portable_config/mpv.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
d3d11-exclusive-fs = no # [当 --gpu-api=d3d11 时] 全屏时独占,默认 no
d3d11-flip = yes # (通常在 --d3d11-exclusive-fs=yes 和 --on-top 一起使用时)禁用它可避免MPV全屏时的冻屏问题,默认 yes

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


Expand Down Expand Up @@ -252,8 +253,10 @@
sub-file-paths =
# 在指定的额外目录中寻找匹配的字幕。支持相对和绝对路径,默认为空
# 例值( sub;subtitles;字幕;C:/字幕库 )即自动搜索当前文件路径下名为"sub","subtitles","字幕"和C盘的"字幕库"文件夹内
slang =
# 字幕首选语言,但MPV优先加载外挂轨道,此项参数可能实际用处不大。默认为空,例值(优选中文) chs,sc,zh,chi,zho
slang = auto
# 字幕首选语言,但MPV优先加载外挂轨道,此项参数可能实际用处不大。
# 默认值为 auto (尝试匹配系统语言),例值(优选中文) chs,sc,zh,chi,zho
subs-fallback = no # <yes|default|默认no> 现有字幕轨无法满足 --slang 的条件时是否回退选择其它字幕,值 default 表示仅选择带有“默认”标记的轨道
blend-subtitles = no # <yes|video|默认no> 在插值和颜色管理之前,将字幕混合到视频帧上。值video类似于yes,但是以视频的原始分辨率绘制字幕,并与视频一起缩放
# 启用此功能会将字幕限制在视频的可见部分(不能出现在视频下方的黑色空白处)
# 还会让字幕受 --icc-profile --target-prim --target-trc --interpolation --gamma-factor --glsl-shaders 的影响
Expand Down
39 changes: 38 additions & 1 deletion portable_config/scripts/osc_plus.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--[[
SOURCE_ https://github.com/mpv-player/mpv/blob/master/player/lua/osc.lua
COMMIT_ b7ffe0d16eec8153d9609382997baaf6a29e5e4f
COMMIT_ 945d7c1eda47c97c4bfba884fb21f398a64b2289
文档_ https://github.com/hooke007/MPV_lazy/discussions/18
改进版本的OSC,不兼容其它OSC类脚本(实现全部功能需搭配 新缩略图引擎 thumbfast )
Expand Down Expand Up @@ -1432,6 +1432,11 @@ layouts["box"] = function ()
{x = posX - pos_offsetX, y = bigbtnrowY, an = 7, w = 70, h = 18}
lo.style = osc_styles.smallButtonsL

lo = add_layout("tog_forced_only")
lo.geometry =
{x = posX - pos_offsetX + 70, y = bigbtnrowY - 1, an = 7, w = 25, h = 18}
lo.style = osc_styles.smallButtonsL

lo = add_layout("tog_fs")
lo.geometry =
{x = posX+pos_offsetX - 25, y = bigbtnrowY, an = 4, w = 25, h = 25}
Expand Down Expand Up @@ -1941,6 +1946,12 @@ function bar_layout(direction)
lo.geometry = geo
lo.style = osc_styles.smallButtonsBar

-- Forced-subs-only button
geo = { x = geo.x - geo.w - padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
lo = add_layout("tog_forced_only")
lo.geometry = geo
lo.style = osc_styles.smallButtonsBar

-- Track selection buttons
geo = { x = geo.x - tsW - padX, y = geo.y, an = geo.an, w = tsW, h = geo.h }
lo = add_layout("cy_sub")
Expand Down Expand Up @@ -2327,6 +2338,32 @@ function osc_init()
ne.eventresponder["shift+mbtn_left_down"] =
function () show_message(get_tracklist("sub"), 2) end

-- tog_forced_only
local tog_forced_only = new_element("tog_forced_only", "button")

ne = tog_forced_only
ne.content = function ()
sub_codec = mp.get_property("current-tracks/sub/codec")
if (sub_codec ~= "dvd_subtitle" and sub_codec ~= "hdmv_pgs_subtitle") then
return ""
end
local base_a = tog_forced_only.layout.alpha
local alpha = base_a[1]
if not mp.get_property_bool("sub-forced-only-cur") then
alpha = 255
end
local ret = assdraw.ass_new()
ret:append("[")
ass_append_alpha(ret, {[1] = alpha, [2] = 1, [3] = base_a[3], [4] = base_a[4]}, 0)
ret:append("F")
ass_append_alpha(ret, base_a, 0)
ret:append("]")
return ret.text
end
ne.eventresponder["mbtn_left_up"] = function ()
mp.set_property_bool("sub-forced-only", (not mp.get_property_bool("sub-forced-only-cur")))
end

ne.eventresponder["wheel_up_press"] =
function () set_track("sub", -1) end
ne.eventresponder["wheel_down_press"] =
Expand Down
11 changes: 5 additions & 6 deletions portable_config/scripts/thumbfast.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--[[
SOURCE_ https://github.com/po5/thumbfast/blob/master/thumbfast.lua
COMMIT_ 8aa6faf10adad899e05cc9b850cde904d37515be
COMMIT_ 4241c7daa444d3859b51b65a39d30e922adb87e9
适配多个OSC类脚本的新缩略图引擎
Expand Down Expand Up @@ -260,8 +260,8 @@ local auto_run = options.auto_run

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

disabled = (w or 0) == 0 or (h or 0) == 0 or
has_vid == 0 or
Expand Down Expand Up @@ -692,8 +692,7 @@ local function update_tracklist(name, value)
-- current-tracks shim
for _, track in ipairs(value) do
if track.type == "video" and track.selected then
properties["current-tracks/video/image"] = track.image
properties["current-tracks/video/albumart"] = track.albumart
properties["current-tracks/video"] = track
return
end
end
Expand Down Expand Up @@ -748,7 +747,7 @@ local function shutdown()
end
end

mp.observe_property("current-tracks", "native", function(name, value)
mp.observe_property("current-tracks/video", "native", function(name, value)
update_property(name, value)
end)

Expand Down
2 changes: 1 addition & 1 deletion portable_config/scripts/uosc/elements/Elements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Elements:remove(idOrElement)
if element then
if not element.destroyed then element:destroy() end
element.enabled = false
self.itable = itable_remove(self.itable, self[id])
self.itable = itable_delete_value(self.itable, self[id])
self[id] = nil
request_render()
end
Expand Down
Loading

0 comments on commit 6309bcb

Please sign in to comment.