1{ lib, stdenv, fetchFromGitHub, fetchpatch, meson, ninja, nasm, xxd }:
2
3stdenv.mkDerivation rec {
4 pname = "libvmaf";
5 version = "2.3.1";
6
7 src = fetchFromGitHub {
8 owner = "netflix";
9 repo = "vmaf";
10 rev = "v${version}";
11 sha256 = "sha256-TkMy2tEdG1FPPWfH/wPnVbs5kocqe4Y0jU4yvbiRZ9k=";
12 };
13
14 sourceRoot = "${src.name}/libvmaf";
15
16 patches = [
17 # Backport fix for non-Linux, non-Darwin platforms.
18 (fetchpatch {
19 url = "https://github.com/Netflix/vmaf/commit/f47640f9ffee9494571bd7c9622e353660c93fc4.patch";
20 stripLen = 1;
21 sha256 = "rsTKuqp8VJG5DBDpixPke3LrdfjKzUO945i+iL0n7CY=";
22 })
23 ];
24
25 nativeBuildInputs = [ meson ninja nasm xxd ];
26
27 mesonFlags = [ "-Denable_avx512=true" ];
28
29 outputs = [ "out" "dev" ];
30 doCheck = false;
31
32 meta = with lib; {
33 description = "Perceptual video quality assessment based on multi-method fusion (VMAF)";
34 homepage = "https://github.com/Netflix/vmaf";
35 changelog = "https://github.com/Netflix/vmaf/raw/v${version}/CHANGELOG.md";
36 license = licenses.bsd2Patent;
37 maintainers = [ maintainers.cfsmp3 maintainers.marsam ];
38 mainProgram = "vmaf";
39 platforms = platforms.unix;
40 };
41
42}