mirror of
https://github.com/rydesun/dotfiles.git
synced 2025-12-26 14:44:58 +08:00
Update mpv config and scripts
This commit is contained in:
parent
3c77c5c12b
commit
06b71ee049
6 changed files with 41 additions and 18 deletions
|
|
@ -19,9 +19,9 @@ Alt+d script-binding uosc/delete-file-next
|
|||
|
||||
ctrl+r cycle_values video-rotate "90" "180" "270" "0"; set geometry 90%x95%+50%+50%
|
||||
|
||||
CTRL+1 apply-profile "common"; show_text ${glsl-shaders}
|
||||
CTRL+2 apply-profile "anime"; show_text ${glsl-shaders}
|
||||
CTRL+1 apply-profile "common"; show_text glsl-shaders=${glsl-shaders}
|
||||
CTRL+2 apply-profile "anime"; show_text glsl-shaders=${glsl-shaders}
|
||||
|
||||
CTRL+8 apply-profile "append-shaders"; show_text ${glsl-shaders}
|
||||
CTRL+9 apply-profile "append-shaders" restore; show_text ${glsl-shaders}
|
||||
CTRL+0 change-list glsl-shaders clr ""
|
||||
CTRL+8 apply-profile "append-shaders"; show_text glsl-shaders=${glsl-shaders}
|
||||
CTRL+9 apply-profile "append-shaders" restore; show_text glsl-shaders=${glsl-shaders}
|
||||
CTRL+0 change-list glsl-shaders clr ""; show_text glsl-shaders=
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
vo=gpu-next
|
||||
|
||||
# 优先硬解码
|
||||
hwdec=auto-safe
|
||||
|
||||
# 播放完不关闭窗口
|
||||
keep-open=yes
|
||||
keep-open
|
||||
|
||||
# 浮动窗口的尺寸最大值
|
||||
autofit-larger=90%x95%
|
||||
|
|
@ -27,16 +29,13 @@ sub-shadow-offset=1
|
|||
# ==== 路径 ====
|
||||
# socket文件路径
|
||||
input-ipc-server=/tmp/mpvsocket
|
||||
screenshot-template="%F(%P)"
|
||||
# 截图目录由脚本 scripts/screenshot.lua 控制
|
||||
# 进度数据目录由脚本 scripts/xdg-dir.lua 控制
|
||||
|
||||
# ==== 渲染 ====
|
||||
profile=high-quality
|
||||
|
||||
# 补帧算法
|
||||
video-sync=display-resample
|
||||
interpolation
|
||||
tscale=oversample
|
||||
|
||||
# 会覆盖scale和cscale
|
||||
# 可选值common或者anime
|
||||
|
|
@ -49,10 +48,10 @@ profile-desc=普通视频
|
|||
glsl-shaders="~~/shaders/FSRCNNX_x2_8-0-4-1.glsl"
|
||||
|
||||
[anime]
|
||||
profile-desc=低分辨率动画
|
||||
profile-desc=低清动画
|
||||
# FSRCNNX着色器
|
||||
# https://github.com/HelpSeeker/FSRCNN-TensorFlow/
|
||||
glsl-shaders="~~/shaders/FSRCNNX_x2_16-0-4-1_anime_enhance.glsl"
|
||||
glsl-shaders="~~/shaders/FSRCNNX_x1_16-0-4-1_distort.glsl"
|
||||
|
||||
# 更多着色器,默认不启用
|
||||
[append-shaders]
|
||||
|
|
|
|||
|
|
@ -3,3 +3,5 @@ top_bar=always
|
|||
use_trash=yes
|
||||
|
||||
controls=menu,gap,<video,audio>subtitles,<has_many_audio>audio,<has_many_video>video,<has_many_edition>editions,<stream>stream-quality,gap,command:add_location_alt:script_message xattr-append-timemark?添加时间标记,<has_chapter>command:wrong_location:script_message xattr-remove-timemark?删除时间标记,<has_chapter>command:edit_location_alt:script_message xattr-modify-timemark-title?编辑时间标记的标题,<has_chapter>toggle:location_on:timemark-combo@timeline_marker?时间标记多级跃迁,space,shuffle,loop-playlist,loop-file,gap,prev,items,next,gap,command:rotate_90_degrees_cw:cycle_values video-rotate "90" "180" "270" "0";set geometry 90%x95%+50%+50%?旋转90°,command:crop_free:set geometry 90%x95%+50%+50%;set video-align-y -1?缩放至屏幕大小
|
||||
|
||||
opacity=timeline=0.5
|
||||
|
|
|
|||
22
.config/mpv/scripts/autoload_fonts.lua
Normal file
22
.config/mpv/scripts/autoload_fonts.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local mp = require 'mp'
|
||||
local utils = require 'mp.utils'
|
||||
|
||||
|
||||
local function find_fonts_dir(base_dir)
|
||||
local sub_dirs = utils.readdir(base_dir, "dirs")
|
||||
if sub_dirs == nil then return end
|
||||
for _, sub_dir in ipairs(sub_dirs) do
|
||||
if sub_dir:lower() == "fonts" then
|
||||
return utils.join_path(base_dir, sub_dir)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
mp.register_event("file-loaded", function()
|
||||
local path = mp.get_property("path")
|
||||
if not path then return end
|
||||
local base_dir = utils.split_path(path)
|
||||
local fonts_dir = find_fonts_dir(base_dir)
|
||||
if not fonts_dir then return end
|
||||
mp.set_property("file-local-options/sub-fonts-dir", fonts_dir)
|
||||
end)
|
||||
|
|
@ -5,7 +5,7 @@ local opt = require 'mp.options'
|
|||
local user_opts = {
|
||||
-- 如果视频位于该目录下的子目录,则截图和视频保存在同一位置
|
||||
dirs = { '/mnt/', '/run/media/' },
|
||||
-- 否则位于XDG图片目录。如果该目录不存在则使用mpv默认值
|
||||
-- 否则位于XDG图片目录下的子目录mpv。如果XDG目录不存在则使用mpv默认值
|
||||
}
|
||||
|
||||
local script_name = mp.get_script_name()
|
||||
|
|
@ -21,8 +21,8 @@ local function use_xdg_dir()
|
|||
args = { 'xdg-user-dir', 'PICTURES' },
|
||||
capture_stdout = true,
|
||||
}
|
||||
local dir = res and res.stdout:gsub('\n', '') or ''
|
||||
mp.set_property('screenshot-directory', dir)
|
||||
local dir = res and res.stdout:gsub('\n', '') .. "/mpv" or ''
|
||||
mp.set_property('file-local-options/screenshot-directory', dir)
|
||||
end
|
||||
|
||||
local function set_screenshot_dir()
|
||||
|
|
@ -34,7 +34,7 @@ local function set_screenshot_dir()
|
|||
local dir, _ = utils.split_path(filepath)
|
||||
for _, prefix in pairs(user_opts.dirs) do
|
||||
if dir:find(prefix, 1, true) then
|
||||
mp.set_property('screenshot-directory', dir)
|
||||
mp.set_property('file-local-options/screenshot-directory', dir)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ echo "Updating shaders..."
|
|||
curl -fL --create-dirs -o "${shader_dir}/FSRCNNX_x2_8-0-4-1.glsl" \
|
||||
https://github.com/igv/FSRCNN-TensorFlow/releases/download/1.1/FSRCNNX_x2_8-0-4-1.glsl
|
||||
|
||||
curl -fL --create-dirs -o "${shader_dir}/FSRCNNX_x2_16-0-4-1_anime_enhance.glsl" \
|
||||
https://github.com/HelpSeeker/FSRCNN-TensorFlow/releases/download/1.1_distort/FSRCNNX_x2_16-0-4-1_anime_enhance.glsl
|
||||
curl -fL --create-dirs -o "${shader_dir}/FSRCNNX_x1_16-0-4-1_distort.glsl" \
|
||||
https://github.com/HelpSeeker/FSRCNN-TensorFlow/releases/download/1.2_distort/FSRCNNX_x1_16-0-4-1_distort.glsl
|
||||
|
||||
curl -fL --create-dirs -o "${shader_dir}/KrigBilateral.glsl" \
|
||||
https://gist.github.com/igv/a015fc885d5c22e6891820ad89555637/raw
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue