| 1 | TERMUX_PKG_HOMEPAGE=https://ffmpeg.org |
| 2 | TERMUX_PKG_DESCRIPTION="Tools and libraries to manipulate a wide range of multimedia formats and protocols" |
| 3 | # NOTE: mpv has to be rebuilt and version bumped after updating ffmpeg. |
| 4 | TERMUX_PKG_VERSION=3.3.4 |
| 5 | TERMUX_PKG_SHA256=98b97e1b908dfeb6aeb6d407e5a5eacdfc253a40c2d195f5867ed2d1d46ea957 |
| 6 | TERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz |
| 7 | TERMUX_PKG_FOLDERNAME=ffmpeg-$TERMUX_PKG_VERSION |
| 8 | # libbz2 is used by matroska decoder: |
| 9 | # libvpx is the VP8 & VP9 video encoder for WebM, see |
| 10 | # https://trac.ffmpeg.org/wiki/Encode/VP8 and https://trac.ffmpeg.org/wiki/Encode/VP9 |
| 11 | TERMUX_PKG_DEPENDS="libbz2, libx264, libx265, xvidcore, libvorbis, libmp3lame, libopus, libvpx, libgnutls" |
| 12 | TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="share/ffmpeg/examples" |
| 13 | TERMUX_PKG_CONFLICTS="libav" |
| 14 | |
| 15 | termux_step_configure () { |
| 16 | cd $TERMUX_PKG_BUILDDIR |
| 17 | |
| 18 | export ASFLAGS="-no-integrated-as" |
| 19 | |
| 20 | local _EXTRA_CONFIGURE_FLAGS="" |
| 21 | if [ $TERMUX_ARCH = "arm" ]; then |
| 22 | _ARCH="armeabi-v7a" |
| 23 | _EXTRA_CONFIGURE_FLAGS="--enable-neon" |
| 24 | elif [ $TERMUX_ARCH = "i686" ]; then |
| 25 | _ARCH="x86" |
| 26 | # Specify --disable-asm to prevent text relocations on i686, |
| 27 | # see https://trac.ffmpeg.org/ticket/4928 |
| 28 | _EXTRA_CONFIGURE_FLAGS="--disable-asm" |
| 29 | elif [ $TERMUX_ARCH = "x86_64" ]; then |
| 30 | _ARCH="x86_64" |
| 31 | elif [ $TERMUX_ARCH = "aarch64" ]; then |
| 32 | _ARCH=$TERMUX_ARCH |
| 33 | _EXTRA_CONFIGURE_FLAGS="--enable-neon" |
| 34 | else |
| 35 | termux_error_exit "Unsupported arch: $TERMUX_ARCH" |
| 36 | fi |
| 37 | |
| 38 | # --disable-lzma to avoid problem with shared library clashes, see |
| 39 | # https://github.com/termux/termux-packages/issues/511 |
| 40 | # Only used for LZMA compression support for tiff decoder. |
| 41 | $TERMUX_PKG_SRCDIR/configure \ |
| 42 | --arch=${_ARCH} \ |
| 43 | --as=$AS \ |
| 44 | --cc=$CC \ |
| 45 | --cxx=$CXX \ |
| 46 | --cross-prefix=${TERMUX_HOST_PLATFORM}- \ |
| 47 | --disable-avdevice \ |
| 48 | --disable-ffserver \ |
| 49 | --disable-static \ |
| 50 | --disable-symver \ |
| 51 | --disable-lzma \ |
| 52 | --enable-cross-compile \ |
| 53 | --enable-gnutls \ |
| 54 | --enable-gpl \ |
| 55 | --enable-libmp3lame \ |
| 56 | --enable-libvorbis \ |
| 57 | --enable-libopus \ |
| 58 | --enable-libx264 \ |
| 59 | --enable-libx265 \ |
| 60 | --enable-libxvid \ |
| 61 | --enable-libvpx \ |
| 62 | --enable-shared \ |
| 63 | --prefix=$TERMUX_PREFIX \ |
| 64 | --target-os=android \ |
| 65 | $_EXTRA_CONFIGURE_FLAGS |
| 66 | } |
| 67 | |