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" head "https://github.com/dirkvdb/ffmpegthumbnailer.git" bottle do cellar :any sha256 "97e88a852fa38a179f2a39e00657211aea29972b0a601ce2f7dd5a5bec86f5ce" => :catalina sha256 "044843eab0cac2d6afdea97ca9f06bc5d1ad51371bb342359aa59402501a3628" => :mojave sha256 "af1f7141227c908fdcb740fd470f7e85a4bef9f3c8c164d561d06dfce4d777f3" => :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