42 lines
1.5 KiB
Ruby
42 lines
1.5 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 5
|
|
head "https://github.com/dirkvdb/ffmpegthumbnailer.git"
|
|
|
|
bottle do
|
|
sha256 cellar: :any, big_sur: "4fd57eb89e6dc46c1b6cba15da66c1654eafd456f290ec3eadf9fe8421b199dc"
|
|
sha256 cellar: :any, catalina: "d2a7c731a25115ba59ca6294dac86c3c4421b587045a8e54afc4cc1ade6c25f4"
|
|
sha256 cellar: :any, mojave: "31c8f2982ec0c2086c0f3698de799c94c67431c5826bc221b95ee466998e8b33"
|
|
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
|