class Ffmpeg < Formula desc "Play, record, convert, and stream audio and video" homepage "https://ffmpeg.org/" url "https://ffmpeg.org/releases/ffmpeg-4.1.tar.xz" sha256 "a38ec4d026efb58506a99ad5cd23d5a9793b4bf415f2c4c2e9c1bb444acd1994" revision 2 head "https://github.com/FFmpeg/FFmpeg.git" bottle do sha256 "9ffd83c7a5290a84e12c7eb1c89ab0aa982eda250162e5e4d0068bafb75ba8d8" => :mojave sha256 "5ef932e6f9be16786ad7868a0651ec26341aee9b21dc8d377633250bb4c502f1" => :high_sierra sha256 "b115f093b37105e4ac25bb4b492e58a4a87610003063a55db088bc62d962b53b" => :sierra end depends_on "nasm" => :build depends_on "pkg-config" => :build depends_on "texi2html" => :build depends_on "freetype" depends_on "frei0r" depends_on "lame" depends_on "libass" depends_on "libvorbis" depends_on "libvpx" depends_on "opencore-amr" depends_on "opus" depends_on "rtmpdump" depends_on "sdl2" depends_on "snappy" depends_on "speex" depends_on "theora" depends_on "x264" depends_on "x265" depends_on "xvid" depends_on "xz" def install args = %W[ --prefix=#{prefix} --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=#{ENV.cc} --host-cflags=#{ENV.cflags} --host-ldflags=#{ENV.ldflags} --enable-ffplay --enable-gpl --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libspeex ] args << "--enable-videotoolbox" if MacOS.version >= :mountain_lion system "./configure", *args system "make", "install" # Build and install additional FFmpeg tools system "make", "alltools" bin.install Dir["tools/*"].select { |f| File.executable? f } end test do # Create an example mp4 file mp4out = testpath/"video.mp4" system bin/"ffmpeg", "-filter_complex", "testsrc=rate=1:duration=1", mp4out assert_predicate mp4out, :exist? end end