mpv: Generate visualiser profiles with function

This commit is contained in:
Simon Bruder 2021-03-09 11:35:13 +01:00
parent 922a359497
commit a3c954fa01
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -158,56 +158,65 @@ in
"Alt+Z" = "add sub-delay +1"; "Alt+Z" = "add sub-delay +1";
}; };
profiles = { profiles =
musicvideo = { let
lavfi-complex = "[aid1]asplit=4[ao][a1][a2][a3];[a1]avectorscope=m=lissajous:s=640x600:draw=dot:r=25[avectorscope];[a2]aresample=44100,showwaves=s=1280x600:mode=p2p:colors=red|lightgreen:r=25[showwaves];[a3]showcqt=s=1920x600:axis=0:axis_h=0:r=25[showcqt];[showwaves][avectorscope]hstack=shortest=1[top];[top][showcqt]vstack=shortest=1,fps=25[vo]"; mkVisualiser = width: height: rate: {
alpha = false; lavfi-complex = lib.concatStringsSep ";" [
}; "[aid1]asplit=4[ao][a1][a2][a3]"
"[a1]avectorscope=m=lissajous:s=${toString (width / 3)}x${toString (height / 2)}:draw=dot:r=${toString rate}[avectorscope]"
"[a2]aresample=44100,showwaves=s=${toString (width / 3 * 2)}x${toString (height / 2)}:mode=p2p:colors=red|lightgreen:r=${toString rate}[showwaves]"
"[a3]showcqt=s=${toString width}x${toString (height / 2)}:axis=0:axis_h=0:r=${toString rate}[showcqt]"
"[showwaves][avectorscope]hstack=shortest=1[top]"
"[top][showcqt]vstack=shortest=1,fps=${toString rate}[vo]"
];
alpha = false;
};
in
{
visualiser = mkVisualiser 1920 1200 30;
visualiser-1080 = mkVisualiser 1920 1080 30;
visualiser-60 = mkVisualiser 1920 1080 60;
visualiser-1080-60 = mkVisualiser 1920 1080 60;
musicvideo-1080 = { hqencode = {
lavfi-complex = "[aid1]asplit=4[ao][a1][a2][a3];[a1]avectorscope=m=lissajous:s=640x540:draw=dot:r=25[avectorscope];[a2]aresample=44100,showwaves=s=1280x540:mode=p2p:colors=red|lightgreen:r=25[showwaves];[a3]showcqt=s=1920x540:axis=0:axis_h=0:r=25[showcqt];[showwaves][avectorscope]hstack=shortest=1[top];[top][showcqt]vstack=shortest=1,fps=25[vo]"; ovc = "libx264";
alpha = false; ovcopts-add = "crf=18";
}; oac = "flac";
audio-format = "s16";
};
hqencode = { lq = {
ovc = "libx264"; scale = "bicubic_fast";
ovcopts-add = "crf=18"; cscale = "bicubic_fast";
oac = "flac"; dscale = "bicubic_fast";
audio-format = "s16"; };
};
lq = { hq = {
scale = "bicubic_fast"; scale = "ewa_lanczossharp";
cscale = "bicubic_fast"; dscale = "mitchell";
dscale = "bicubic_fast"; linear-downscaling = "no"; # for KrigBilateral
}; cscale = "ewa_lanczos";
glsl-shader = [
"${shaders.SSimDownscaler}" # dscale
"${shaders.KrigBilateral}" # cscale
"${shaders.fsrcnnx_x2}" # scale
];
};
hq = { interpolate = {
scale = "ewa_lanczossharp"; blend-subtitles = true;
dscale = "mitchell"; video-sync = "display-resample";
linear-downscaling = "no"; # for KrigBilateral interpolation = true;
cscale = "ewa_lanczos"; tscale = "box";
glsl-shader = [ tscale-window = "sphinx";
"${shaders.SSimDownscaler}" # dscale tscale-radius = 1.0;
"${shaders.KrigBilateral}" # cscale tscale-clamp = 0.0;
"${shaders.fsrcnnx_x2}" # scale };
];
};
interpolate = { # adapted from https://github.com/mpv-player/mpv/issues/4418#issuecomment-368272929
blend-subtitles = true; clear-speed.af-add = "scaletempo=stride=18:overlap=.6:search=10";
video-sync = "display-resample";
interpolation = true;
tscale = "box";
tscale-window = "sphinx";
tscale-radius = 1.0;
tscale-clamp = 0.0;
}; };
# adapted from https://github.com/mpv-player/mpv/issues/4418#issuecomment-368272929
clear-speed.af-add = "scaletempo=stride=18:overlap=.6:search=10";
};
scripts = [ scripts = [
pitchcontrol pitchcontrol
]; ];