diff --git a/Formula/libvmaf.rb b/Formula/libvmaf.rb new file mode 100644 index 0000000000..fb7fed9bdc --- /dev/null +++ b/Formula/libvmaf.rb @@ -0,0 +1,21 @@ +class Libvmaf < Formula + desc "Perceptual video quality assessment based on multi-method fusion" + homepage "https://github.com/Netflix/vmaf" + url "https://github.com/Netflix/vmaf/archive/v1.3.9.tar.gz" + sha256 "c9e4fc850f66cf959a36c9603cef26c4298eec20d6c26f9482a355c5753c092d" + + def install + system "make" + system "make", "install", "INSTALL_PREFIX=#{prefix}" + system "make", "testlib", "INSTALL_PREFIX=#{prefix}" + pkgshare.install "wrapper/testlib" + pkgshare.install "python/test/resource/yuv/src01_hrc00_576x324.yuv" + end + + test do + yuv = "#{pkgshare}/src01_hrc00_576x324.yuv" + pkl = "#{share}/model/vmaf_v0.6.1.pkl" + output = shell_output("#{pkgshare}/testlib yuv420p 576 324 #{yuv} #{yuv} #{pkl}") + assert_match "VMAF score = ", output + end +end