110 lines
3 KiB
Ruby
110 lines
3 KiB
Ruby
class Ffmpeg < Formula
|
|
desc "Play, record, convert, and stream audio and video"
|
|
homepage "https://ffmpeg.org/"
|
|
url "https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.xz"
|
|
sha256 "cec7c87e9b60d174509e263ac4011b522385fd0775292e1670ecc1180c9bb6d4"
|
|
revision 2
|
|
head "https://github.com/FFmpeg/FFmpeg.git"
|
|
|
|
bottle do
|
|
sha256 "11b16a8f9657e0826774d41133052b088f778a50f6f8037f641923cbb6b90335" => :catalina
|
|
sha256 "a8dfa8eb401973fb9aa2adf806fca3e2a091ccb16d1270b5dcd67283022ba05b" => :mojave
|
|
sha256 "67fa397296c48e8f838a4cfbd654da8888a7e579eb53bda46e2d2ca70908d14e" => :high_sierra
|
|
end
|
|
|
|
depends_on "nasm" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "texi2html" => :build
|
|
|
|
depends_on "aom"
|
|
depends_on "fontconfig"
|
|
depends_on "freetype"
|
|
depends_on "frei0r"
|
|
depends_on "gnutls"
|
|
depends_on "lame"
|
|
depends_on "libass"
|
|
depends_on "libbluray"
|
|
depends_on "libsoxr"
|
|
depends_on "libvidstab"
|
|
depends_on "libvorbis"
|
|
depends_on "libvpx"
|
|
depends_on "opencore-amr"
|
|
depends_on "openjpeg"
|
|
depends_on "opus"
|
|
depends_on "rtmpdump"
|
|
depends_on "rubberband"
|
|
depends_on "sdl2"
|
|
depends_on "snappy"
|
|
depends_on "speex"
|
|
depends_on "tesseract"
|
|
depends_on "theora"
|
|
depends_on "x264"
|
|
depends_on "x265"
|
|
depends_on "xvid"
|
|
depends_on "xz"
|
|
|
|
def install
|
|
# Work around Xcode 11 clang bug
|
|
# https://bitbucket.org/multicoreware/x265/issues/514/wrong-code-generated-on-macos-1015
|
|
ENV.append_to_cflags "-fno-stack-check" if DevelopmentTools.clang_build_version >= 1010
|
|
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--enable-shared
|
|
--enable-pthreads
|
|
--enable-version3
|
|
--enable-avresample
|
|
--cc=#{ENV.cc}
|
|
--host-cflags=#{ENV.cflags}
|
|
--host-ldflags=#{ENV.ldflags}
|
|
--enable-ffplay
|
|
--enable-gnutls
|
|
--enable-gpl
|
|
--enable-libaom
|
|
--enable-libbluray
|
|
--enable-libmp3lame
|
|
--enable-libopus
|
|
--enable-librubberband
|
|
--enable-libsnappy
|
|
--enable-libtesseract
|
|
--enable-libtheora
|
|
--enable-libvidstab
|
|
--enable-libvorbis
|
|
--enable-libvpx
|
|
--enable-libx264
|
|
--enable-libx265
|
|
--enable-libxvid
|
|
--enable-lzma
|
|
--enable-libfontconfig
|
|
--enable-libfreetype
|
|
--enable-frei0r
|
|
--enable-libass
|
|
--enable-libopencore-amrnb
|
|
--enable-libopencore-amrwb
|
|
--enable-libopenjpeg
|
|
--enable-librtmp
|
|
--enable-libspeex
|
|
--enable-libsoxr
|
|
--enable-videotoolbox
|
|
--disable-libjack
|
|
--disable-indev=jack
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
|
|
# Build and install additional FFmpeg tools
|
|
system "make", "alltools"
|
|
bin.install Dir["tools/*"].select { |f| File.executable? f }
|
|
|
|
# Fix for Non-executables that were installed to bin/
|
|
mv bin/"python", pkgshare/"python", :force => true
|
|
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
|