From c7c812b49f82f39030d99db00fa663a0db9bdd74 Mon Sep 17 00:00:00 2001 From: Tibeuleu <> Date: Sun, 23 Nov 2025 12:10:54 +0100 Subject: [PATCH] mpv scripts --- .config/mpv/mpv.conf | 4 ++-- .config/mpv/scripts/skipsilence.lua | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 2c29f0a..06e1d2b 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -57,7 +57,7 @@ # Specify fast video rendering preset (for --vo= only) # Recommended for mobile devices or older hardware with limited processing power -#profile=fast +profile=fast # Specify high quality video rendering preset (for --vo= only) # Offers superior image fidelity and visual quality for an enhanced viewing @@ -73,7 +73,7 @@ # video outputs, but should work well with default settings on most systems. # If performance or energy usage is an issue, forcing the vdpau or vaapi VOs # may or may not help. -# hwdec=auto +hwdec=auto ################## # audio settings # diff --git a/.config/mpv/scripts/skipsilence.lua b/.config/mpv/scripts/skipsilence.lua index 95f5e2d..5a6b3de 100644 --- a/.config/mpv/scripts/skipsilence.lua +++ b/.config/mpv/scripts/skipsilence.lua @@ -3,6 +3,19 @@ -- -- Main repository: https://codeberg.org/ferreum/mpv-skipsilence/ -- +-- Based on the script https://gist.github.com/bitingsock/e8a56446ad9c1ed92d872aeb38edf124 +-- +-- This is inspired by the NewPipe app's built-in "Fast-forward during silence" +-- feature. +-- +-- Note: In mpv version 0.36 and below, the `scaletempo2` filter (default since +-- mpv version 0.34) caused audio-video de-synchronization when changing speed +-- a lot. This has been fixed in mpv 0.37. See [mpv issue +-- #12028](https://github.com/mpv-player/mpv/issues/12028). Small, frequent +-- speed changes instead of large steps may help to reduce this problem. The +-- scaletempo and rubberband filters didn't have this problem, but have +-- different audio quality characteristics. +-- -- Features: -- - Parameterized speedup ramp, allowing profiles for different kinds of -- media (ramp_*, speed_*, startdelay options). @@ -93,10 +106,7 @@ -- 'change-list', 'Key/value list options', and 'Configuration' for the -- 'script-opts/osc.conf' documentation. -- Use the prefix 'skipsilence' (unless the script was renamed). -local mp = require "mp" -local opt = require "mp.options" - -local options = { +local opts = { -- Whether skipsilence should be enabled by default. Can also be changed -- at runtime and reflects the current enabled state. enabled = false, @@ -258,13 +268,11 @@ local options = { -- If 'off', the script will override the speed during silence. -- Note: this option is unreliable in cases where the script changes speed -- at the exact same time. Prefer the adjust-speed message instead. - apply_speed_change = "add", + apply_speed_change = "off", debug = false, } -opt.read_options(options) - local is_enabled = false local base_speed = 1 local is_silent = false