Skip to content

Instantly share code, notes, and snippets.

View hooke007's full-sized avatar
💭
working

Karl Hook hooke007

💭
working
View GitHub Profile
@hooke007
hooke007 / audio_balance.lua
Last active August 13, 2023 18:19
[mpv-script] 声道平衡
--[[
SOURCE_ https://github.com/wiiaboo/mpv-scripts/blob/master/audio-balance.lua
COMMIT_ 20220811 03cfc0e39682a73d9d24a6e01a3c02716a019d1d
声道平衡
立体声使用的是仅削弱单边的逻辑,但多声道仍沿用了原设计(存在问题)中的混合思路
示例在 input.conf 中写入 :
Ctrl+A script-binding audio_balance/bal2l # 平衡偏左(步进1%,按住可持续触发)
@hooke007
hooke007 / opt_helper.lua
Last active November 1, 2023 15:12
[mpv-script] uosc的辅助脚本
--[[
依赖的前置脚本: https://github.com/hooke007/MPV_lazy/tree/main/portable_config/scripts/uosc
用于:
实时简易快速切换 --cscale --scale --dscale --tscale 的各值
快速预览各用户着色器(仅解析 `~~/shaders/` 目录)
input.conf 示例:
@hooke007
hooke007 / auto_loudnorm.lua
Last active February 28, 2024 03:58
[mpv-script] 自动均衡多声道音频
--[[
-- 旧实现和 https://github.com/mpv-player/mpv/issues/11541 的问题一致
function check_achannels()
local channel_count = mp.get_property_number("audio-params/channel-count")
if channel_count and channel_count > 2 then
mp.commandv("af", "pre", "@vocal:loudnorm")
else
mp.commandv("af", "remove", "@vocal")
end
###匹配版本 https://github.com/mpv-player/mpv/blob/828dd65ef84b4d8e95e70752b9eb0833909d1d23/TOOLS/lua/autoload.lua
###不支持参数后注释,须另起一行
##是否禁用所有自动加载相关功能,默认:no
#disabled=yes
##是否自动加载当前目录(不含子目录)所有图片(视频、音频)到播放列表,默认:yes
images=no
#videos=no
audio=no
@hooke007
hooke007 / main.lua
Created October 2, 2022 20:30
[mpv-script(dir)] 多osc-like脚本共存测试
-- 能用但没必要
-- 快捷键需要重映射
-- 脚本选项可能需要重映射(或者选择修改脚本)
require("mp.options")
local opts = {
UI = "",
}
@hooke007
hooke007 / SR_EDI_US_STD_obs.vpy
Last active July 14, 2023 01:01
[mpv-filter_vapoursynth] 图像放大
### 使用nnedi3算法进行两倍放大
### 追求速度应使用着色器版本,例如 ../shaders/nnedi3-nns128-win8x4.glsl
### 依赖列表:
### https://github.com/EleonoreMizo/fmtconv/releases/tag/r30
### https://github.com/dubhater/vapoursynth-nnedi3/releases/tag/v12
### https://github.com/sekrit-twc/znedi3/releases/tag/r2.1
### https://github.com/HomeOfVapourSynthEvolution/VapourSynth-NNEDI3CL/releases/tag/r8
import vapoursynth as vs
from vapoursynth import core
@hooke007
hooke007 / SR_WAIFU_STD_obs.vpy
Last active July 14, 2023 01:05
[mpv-filter_vapoursynth] 图像放大
### waifu2x算法放大两倍
### 依赖: https://github.com/nlzy/vapoursynth-waifu2x-ncnn-vulkan/releases/tag/r5 (模型文件在r0.1)
import vapoursynth as vs
from vapoursynth import core
input = video_in
colorlv = input.get_frame(0).props._ColorRange
fmt_fin = input.format.id
@hooke007
hooke007 / mpv_vapoursynth_portable.md
Last active March 15, 2024 03:23
windows10+快速部署一体化便携式mpv-vs工具链
@hooke007
hooke007 / SR_CUGAN_STD_obs.vpy
Last active July 14, 2023 00:58
[mpv-filter_vapoursynth] 图像放大
### Real-CUGAN 放大
### 依赖: https://github.com/Kiyamou/VapourSynth-RealCUGAN-ncnn-Vulkan/releases/tag/r2
import vapoursynth as vs
from vapoursynth import core
input = video_in
colorlv = input.get_frame(0).props._ColorRange
denoise_lv = -1
@hooke007
hooke007 / cycle_commands.js
Created August 4, 2022 11:58
[mpv-script] 快捷键循环命令
// 使用单个快捷键依次执行指令
// input.conf
// KEY script-message cycle-cmd "CMD1" "CMD2"
// Created by https://github.com/avih
var registry = {};
mp.register_script_message("cycle-cmd", function() {
var key = JSON.stringify(arguments);
if (!(registry[key] >= 0))