mpv: ship a music visualizer

note that it doesnt show in `webm` exports
This commit is contained in:
Colin 2024-05-25 02:05:09 +00:00
parent e407467e55
commit 27b4d4da16
3 changed files with 24 additions and 0 deletions

View File

@ -6,6 +6,7 @@
# extensions i use:
# - <https://github.com/jonniek/mpv-playlistmanager>
# - <https://github.com/ekisu/mpv-webm>
# - <https://github.com/mfcc64/mpv-scripts/blob/master/visualizer.lua>
# other extensions that could be useful:
# - list: <https://github.com/stax76/awesome-mpv>
# - list: <https://nudin.github.io/mpv-script-directory/>
@ -125,6 +126,15 @@ let
'"cycle fullscreen",'
'';
});
visualizer = pkgs.mpvScripts.visualizer.overrideAttrs (upstream: {
postPatch = (upstream.postPatch or "") + ''
# don't have the script register its own keybinding: i'll do it manually via input.conf.
# substituteInPlace visualizer.lua --replace-fail \
# 'mp.add_key_binding' '-- mp.add_key_binding'
substituteInPlace visualizer.lua --replace-fail \
'cycle_key = "c"' 'cycle_key = "v"'
'';
});
mpv-unwrapped = pkgs.mpv-unwrapped.overrideAttrs (upstream: {
version = "0.37.0-unstable-2024-03-31";
src = lib.warnIf (lib.versionOlder "0.37.0" upstream.version) "mpv outdated; remove patch?" pkgs.fetchFromGitHub {
@ -151,6 +161,7 @@ in
pkgs.mpvScripts.mpv-playlistmanager
pkgs.mpvScripts.mpv-webm
uosc
visualizer
# pkgs.mpv-uosc-latest
];
# extraMakeWrapperArgs = lib.optionals (cfg.config.vo != null) [
@ -228,6 +239,7 @@ in
fs.".config/mpv/script-opts/uosc.conf".symlink.target = ./uosc.conf;
fs.".config/mpv/script-opts/playlistmanager.conf".symlink.target = ./playlistmanager.conf;
fs.".config/mpv/script-opts/webm.conf".symlink.target = ./webm.conf;
fs.".config/mpv/script-opts/visualizer.conf".symlink.target = ./visualizer.conf;
# mime.priority = 200; # default = 100; 200 means to yield to other apps
mime.priority = 50; # default = 100; 50 in order to take precedence over vlc.

View File

@ -35,3 +35,6 @@ O script-binding uosc/show-in-directory #! Utils > Show in directory
# script-binding uosc/open-config-directory #! Utils > Open config directory
ctrl+r script-binding sane_cast/blast #! Audiocast
ctrl+t script-binding sane_cast/sane-cast #! Cast
# reserved: it uses this internally, isn't externally callable
# v script-binding cycle-visualizer

View File

@ -0,0 +1,9 @@
# config:
# - <https://raw.githubusercontent.com/mfcc64/mpv-scripts/master/visualizer.lua>
name=off
# height: {4..12}
# - multi functional. for spectrograph, impacts the length of its tape
height=4
# quality: {verylow,low,medium,high,veryhigh}
# - multi functional. seems to impact the FFT size, and thereby how quickly the spectrograph advances
quality=medium