homebrew-core/Formula/ffmpegthumbnailer.rb

43 lines
1.4 KiB
Ruby

class Ffmpegthumbnailer < Formula
desc "Create thumbnails for your video files"
homepage "https://github.com/dirkvdb/ffmpegthumbnailer"
url "https://github.com/dirkvdb/ffmpegthumbnailer/archive/2.2.2.tar.gz"
sha256 "8c4c42ab68144a9e2349710d42c0248407a87e7dc0ba4366891905322b331f92"
license "GPL-2.0"
revision 3
head "https://github.com/dirkvdb/ffmpegthumbnailer.git"
bottle do
cellar :any
sha256 "915a04936eca7625df70cd9725b8ec8814ee837631364bbf8ff3299f7e0975c6" => :catalina
sha256 "8cc412573d4977a12dacc999484ea691ee267e8d4e59d6a855f2c47aa4790d0f" => :mojave
sha256 "f7e7e0aeb5f0401ace3976a253373c9351ca1ec1eebb74af826d827dca631e05" => :high_sierra
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "ffmpeg"
depends_on "jpeg"
depends_on "libpng"
def install
args = std_cmake_args
args << "-DENABLE_GIO=ON"
args << "-DENABLE_THUMBNAILER=ON"
system "cmake", *args
system "make"
system "make", "install"
end
test do
f = Formula["ffmpeg"].opt_bin/"ffmpeg"
png = test_fixtures("test.png")
system f.to_s, "-loop", "1", "-i", png.to_s, "-c:v", "libx264", "-t", "30",
"-pix_fmt", "yuv420p", "v.mp4"
assert_predicate testpath/"v.mp4", :exist?, "Failed to generate source video!"
system "#{bin}/ffmpegthumbnailer", "-i", "v.mp4", "-o", "out.jpg"
assert_predicate testpath/"out.jpg", :exist?, "Failed to create thumbnail!"
end
end