mpv: Add motion vector interpolation script
This commit is contained in:
parent
ef9731a080
commit
0fdfec4385
|
@ -9,7 +9,7 @@
|
|||
./htop.nix
|
||||
./misc.nix
|
||||
./mpd.nix
|
||||
./mpv.nix
|
||||
./mpv
|
||||
./neovim.nix
|
||||
./pass.nix
|
||||
./programs.nix
|
||||
|
|
|
@ -48,6 +48,20 @@ in
|
|||
# mpv can also be useful without a display (e.g. for encoding)
|
||||
enable = nixosConfig.sbruder.gui.enable || nixosConfig.sbruder.full;
|
||||
|
||||
package = pkgs.wrapMpv
|
||||
(pkgs.mpv-unwrapped.override {
|
||||
vapoursynthSupport = true;
|
||||
vapoursynth = pkgs.vapoursynth.withPlugins (with pkgs; [
|
||||
vapoursynth-mvtools
|
||||
]);
|
||||
})
|
||||
{
|
||||
scripts = with pkgs.mpvScripts; [
|
||||
pitchcontrol
|
||||
sponsorblock
|
||||
];
|
||||
};
|
||||
|
||||
defaultProfiles = [
|
||||
"gpu-hq" # High quality by default
|
||||
];
|
||||
|
@ -208,14 +222,11 @@ in
|
|||
tscale-clamp = 0.0;
|
||||
};
|
||||
|
||||
mvinterpolate.vf-add = "vapoursynth=${./mvinterpolate.py}";
|
||||
|
||||
# adapted from https://github.com/mpv-player/mpv/issues/4418#issuecomment-368272929
|
||||
clear-speed.af-add = "scaletempo=stride=18:overlap=.6:search=10";
|
||||
};
|
||||
|
||||
scripts = with pkgs.mpvScripts; [
|
||||
pitchcontrol
|
||||
sponsorblock
|
||||
];
|
||||
};
|
||||
|
||||
# mpv-gallery-view is not compatible with home-manager’s script injection meachanism
|
20
users/simon/modules/mpv/mvinterpolate.py
Normal file
20
users/simon/modules/mpv/mvinterpolate.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
import vapoursynth as vs
|
||||
|
||||
core = vs.core
|
||||
|
||||
clip = core.std.AssumeFPS(video_in, fpsnum=int(container_fps * 1000), fpsden=1000)
|
||||
|
||||
sup = core.mv.Super(clip, pel=2)
|
||||
bvec = core.mv.Analyse(sup, isb=True)
|
||||
fvec = core.mv.Analyse(sup, isb=False)
|
||||
hfr = core.mv.BlockFPS(
|
||||
clip,
|
||||
sup,
|
||||
bvec,
|
||||
fvec,
|
||||
num=int(display_fps * 1000),
|
||||
den=1000,
|
||||
thscd1=140,
|
||||
thscd2=38,
|
||||
)
|
||||
hfr.set_output()
|
Loading…
Reference in a new issue