44 lines
1.5 KiB
Ruby
44 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 4
|
|
head "https://github.com/dirkvdb/ffmpegthumbnailer.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "ce055cde5dbe042f8542aca036836f48b0a414168a2474bee0e86b306928b077" => :big_sur
|
|
sha256 "08386f0b8bef0e4e4d7faf5204226b3a165b03c46b6f77fcd024abc5708e48a4" => :catalina
|
|
sha256 "2873371242e9835e8b781290d8655b7a28c11ccaabc6abcff9aaf26bed9f28b5" => :mojave
|
|
sha256 "d1a7c7b565dbe5c045c4cfaaff76a536703b3aa7ffdb7f505d8feafb2ee54d00" => :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
|