From 09850cda27f7bd43647f63bf776556075883446f Mon Sep 17 00:00:00 2001 From: FlyingWombat <25214020+FlyingWombat@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:23:51 -0600 Subject: [PATCH] av1an: vapoursynth support Corrected wrapper entries: - Need to override vapoursynth with `vapoursynth.withPlugins` for av1an to be able to use VS plugins. Changed PYTHON_PATH accordingly. Passing `pkgs.vapoursynth` to `python3Packages.makePythonPath` makes an incorrect path entry, resulting in segfault when the program is run. - Need LD_LIBRARY_PATH to use VS plugins (e.g. ffms2 and lsmash, the recommended chunking method). Otherwise get e.g. `Error: FFMS2 is not installed, but it was specified as the chunk method`. - Need vapoursynth in PATH to use VS based chunking methods or VS script as input. At least, `vspipe` binary needs to be visible in PATH. Add mkvtoolnix option; it is the recommended concatenation method. --- pkgs/by-name/av/av1an/package.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/av/av1an/package.nix b/pkgs/by-name/av/av1an/package.nix index ec3a4d66ae8b..1333ce81c8b4 100644 --- a/pkgs/by-name/av/av1an/package.nix +++ b/pkgs/by-name/av/av1an/package.nix @@ -5,7 +5,7 @@ testers, av1an-unwrapped, ffmpeg, - python3Packages, + python3, libaom, svt-av1, rav1e, @@ -13,6 +13,8 @@ x264, x265, libvmaf, + vapoursynth, + mkvtoolnix-cli, withAom ? true, # AV1 reference encoder withSvtav1 ? false, # AV1 encoder/decoder (focused on speed and correctness) withRav1e ? false, # AV1 encoder (focused on speed and safety) @@ -20,6 +22,7 @@ withX264 ? true, # H.264/AVC encoder withX265 ? true, # H.265/HEVC encoder withVmaf ? false, # Perceptual video quality assessment algorithm + withMkvtoolnix ? true, # mkv editor, recommended concatenation method }: # av1an requires at least one encoder assert lib.assertMsg (lib.elem true [ @@ -40,19 +43,24 @@ symlinkJoin { postBuild = let runtimePrograms = - [ (ffmpeg.override { inherit withVmaf; }) ] + [ + vapoursynth + (ffmpeg.override { inherit withVmaf; }) + ] ++ lib.optional withAom libaom ++ lib.optional withSvtav1 svt-av1 ++ lib.optional withRav1e rav1e ++ lib.optional withVpx libvpx ++ lib.optional withX264 x264 ++ lib.optional withX265 x265 - ++ lib.optional withVmaf libvmaf; + ++ lib.optional withVmaf libvmaf + ++ lib.optional withMkvtoolnix mkvtoolnix-cli; in '' wrapProgram $out/bin/av1an \ + --prefix LD_LIBRARY_PATH : ${vapoursynth}/lib \ --prefix PATH : ${lib.makeBinPath runtimePrograms} \ - --prefix PYTHONPATH : ${python3Packages.makePythonPath [ python3Packages.vapoursynth ]} + --prefix PYTHONPATH : ${vapoursynth}/${python3.sitePackages} ''; passthru = {